Skip to content

Instantly share code, notes, and snippets.

@austin-millan
Created June 12, 2021 23:27
Show Gist options
  • Save austin-millan/06b52692040f156d760e25fb0ff39061 to your computer and use it in GitHub Desktop.
Save austin-millan/06b52692040f156d760e25fb0ff39061 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 i, 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