Skip to content

Instantly share code, notes, and snippets.

@collinvandyck
Created June 12, 2014 18:30
Show Gist options
  • Select an option

  • Save collinvandyck/f0911e99bfd7275ca278 to your computer and use it in GitHub Desktop.

Select an option

Save collinvandyck/f0911e99bfd7275ca278 to your computer and use it in GitHub Desktop.
for _, foo := range foos {
// is there a valid reason for ever taking the address of a
// variable written to by range?
process(&foo)
}
@sharvell

Copy link
Copy Markdown

no, use index or pointer but good reminder ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment