Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.
/ atomicvalue Public archive

Atomic bool/int library for cleaner Go code. Wrapper for "sync/atomic" package.

License

Notifications You must be signed in to change notification settings

aermolaev/atomicvalue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

atomicvalue

Wrapper for "sync/atomic" package.

Installation

go get github.com/aermolaev/atomicvalue

Simple Example

var b atomicvalue.Bool

fmt.Println(b.Get()) // false

b.Set(true)
fmt.Println(b.Get()) // true
var i atomicvalue.Int

fmt.Println(i.Get()) // 0

i.Set(10)
fmt.Println(i.Get()) // 10

i.Inc()
fmt.Println(i.Get()) // 11

i.Add(-5)
fmt.Println(i.Get()) // 6

About

Atomic bool/int library for cleaner Go code. Wrapper for "sync/atomic" package.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages