tss/exp/ref/main.go
2022-05-01 23:29:02 -04:00

36 lines
440 B
Go

package main
import "fmt"
type dummy struct {
name string
}
func main() {
fmt.Println("vim-go")
dummies := []dummy{
dummy{"foo"},
dummy{"bar"},
dummy{"baz"},
}
for i, _ := range dummies {
dum := &dummies[i]
dum.name = "hello"
}
for _, dum := range dummies {
fmt.Println(dum.name)
}
foo()
}
func foo() {
var stuff []string
defer fmt.Println(stuff)
stuff = append(stuff, "foo")
stuff = append(stuff, "bar")
}