consistenthash is an implementation of a consistent hash in Go
This technique is explained in these links:
There is also a popular existing quality Go implementation here:
This package is not a copy of that and was developed clean-room from the wikipedia article. Check out that link also if you are evaluating software to provide this functionality.