Skip to content

Instantly share code, notes, and snippets.

@shixzie
Created July 29, 2017 04:08
Show Gist options
  • Save shixzie/37b78ec57f0d9dabeecc1dc3747466f7 to your computer and use it in GitHub Desktop.
Save shixzie/37b78ec57f0d9dabeecc1dc3747466f7 to your computer and use it in GitHub Desktop.
// Why not
func Add<T>(addr *T, delta T) (new T)
otherInt32 := atomic.Add<int32>(&myInt32, 32)
// Instead of
func AddInt32(addr *int32, delta int32) (new int32)
otherInt32 := atomic.AddInt32(&myInt32, 32)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment