mirror of
https://github.com/teivah/100-go-mistakes.git
synced 2026-06-20 16:45:56 +08:00
10 lines
122 B
Go
10 lines
122 B
Go
package counter
|
|
|
|
import "sync/atomic"
|
|
|
|
var count uint64
|
|
|
|
func Inc() uint64 {
|
|
atomic.AddUint64(&count, 1)
|
|
return count
|
|
}
|