nightlyone / atomic

Atomic operations as methods on types

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

atomic

Atomic operations as methods on types

Go Reference Build Status

example usage

package main

import (
	"fmt"

	"github.com/nightlyone/atomic"
)

type Service struct {
	Health atomic.Bool
}

func main() {
	service := new(Service)
	isHealthy := service.Health.Value()
	fmt.Printf("service is healthy? %t\n", isHealthy)
	// Output: service is healthy? false
}

LICENSE

BSD-3-Clause

Contributing

Pull requests and github issues welcome.

About

Atomic operations as methods on types

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Go 100.0%