feudal/sequence/serial.go
Matthew Rich c545200ade
Some checks failed
Lint / golangci-lint (push) Failing after 9m57s
Declarative Tests / test (push) Failing after 10s
add initial commit
2024-04-04 12:43:46 -07:00

17 lines
270 B
Go

// Copyright 2024 Matthew Rich <matthewrich.conf@gmail.com>. All rights reserved.
package sequence
import (
"sync/atomic"
)
type Serial32 func() uint32
func NewSerial32() Serial32 {
var c uint32 = 0
return func() uint32 { return atomic.AddUint32(&c, 1) }
}