Jimmie Butler
Jimmie's Mostly Tech Blog

Jimmie's Mostly Tech Blog

Series

Golang


Articles in this series

Go Basics: For loop suprise!

Nov 15, 20212 min read

What happens when we run this code? func main() { data := []string{"Hello", "World"} toPrint := []*string{} for _, a := range data { toPrint = append(toPrint, &a) } for _, p := range toPrint { fmt.Println(*p) ...

Go Basics: For loop suprise!