File: id.go

package info (click to toggle)
golang-github-joomcode-errorx 1.2.0-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 280 kB
  • sloc: makefile: 2
file content (13 lines) | stat: -rw-r--r-- 301 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
package errorx

import (
	"sync/atomic"
)

var internalID uint64

// nextInternalID creates next unique id for errorx entities.
// All equality comparison should take id into account, lest there be some false positive matches.
func nextInternalID() uint64 {
	return atomic.AddUint64(&internalID, 1)
}