Skip to content

Instantly share code, notes, and snippets.

@siburu
Last active June 28, 2019 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save siburu/8526babc4ac89da7fc082660b325401f to your computer and use it in GitHub Desktop.
Save siburu/8526babc4ac89da7fc082660b325401f to your computer and use it in GitHub Desktop.
package main
type S struct {
i int
}
func main() {
var a []*int
for _, s := range []S{{1},{2},{3}} {
a = append(a, &s.i)
}
for _, p := range a {
println(*p)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment