Skip to content

Instantly share code, notes, and snippets.

@austin-millan
Last active June 12, 2021 23:40
Show Gist options
  • Save austin-millan/50b067849922189ce4c6b7e7b10b1fb8 to your computer and use it in GitHub Desktop.
Save austin-millan/50b067849922189ce4c6b7e7b10b1fb8 to your computer and use it in GitHub Desktop.
Markdium-
package main
import (
"fmt"
)
type A struct {
ValA int `json:"valA"`
ValB int `json:"valB"`
}
func main() {
input := []A{{ValA: 1},{ValA: 2}}
for _, a := range input {
fmt.Printf("%p\n", &a) // `a` addr
a.ValA *= 10
}
fmt.Println(input)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment