This package is a snowflake implementation in Golang without lock.
go get github.com/LuckyStarry/snowflake
uid := snowflake.NextID()
or you have an explicit worker id (machine id) like this:
uid := snowflake.NextIDWorker(workerId)
Code and documentation copyright 2017 Sun Bo. Code released under the MIT license.