Skip to content

Instantly share code, notes, and snippets.

@betandr
Created December 4, 2018 13:20
Show Gist options
  • Save betandr/2bd8dfc7033ee21374f514ece6d3a1f5 to your computer and use it in GitHub Desktop.
Save betandr/2bd8dfc7033ee21374f514ece6d3a1f5 to your computer and use it in GitHub Desktop.
Structs with pointers in Go
pp := new(Point)
*pp = Point{1, 2}
// is equvalent to
pp := &Point{1, 2}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment