Skip to content
This repository was archived by the owner on Jun 11, 2026. It is now read-only.

nightlyone/atomic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

atomic

Atomic operations as methods on types

Note: As of Go 1.19 the standard library package sync/atomic implements similar data types, so this package here will not see further development. It will stay archived.

Go Reference

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

About

Atomic operations as methods on types

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages