Last active
June 12, 2021 23:40
-
-
Save austin-millan/50b067849922189ce4c6b7e7b10b1fb8 to your computer and use it in GitHub Desktop.
Markdium-
This file contains 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 _, 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