Skip to content

Commit

Permalink
messageID: add documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Koichi Shiraishi <zchee.io@gmail.com>
  • Loading branch information
zchee committed Feb 24, 2022
1 parent daa4329 commit 93ff3fb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions messageID.go
Expand Up @@ -19,6 +19,10 @@ type safeID struct {
nextID int64
}

// make sure safeID implements the IDGenerator interface.
var _ IDGenerator = (*safeID)(nil)

// Next implements IDGenerator.Next.
func (s *safeID) Next() int {
id := atomic.AddInt64(&s.nextID, 1)

Expand Down

0 comments on commit 93ff3fb

Please sign in to comment.