17 lines
270 B
Go
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) }
|
|
}
|