Atomic operations as methods on types
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
}
BSD-3-Clause
Pull requests and github issues welcome.