diff options
Diffstat (limited to 'internal')
-rw-r--r-- | internal/generation_num/generation_num.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/generation_num/generation_num.go b/internal/generation_num/generation_num.go new file mode 100644 index 0000000..298db14 --- /dev/null +++ b/internal/generation_num/generation_num.go @@ -0,0 +1,11 @@ +package generation_num + +import ( + "sync/atomic" +) + +var gen uint64 + +func Next() uint64 { + return atomic.AddUint64(&gen, 1) +} |