Created
June 12, 2021 23:27
-
-
Save austin-millan/06b52692040f156d760e25fb0ff39061 to your computer and use it in GitHub Desktop.
Markdium-
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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