Files
moxa/_test/method8.go
2018-08-31 11:44:56 +02:00

24 lines
267 B
Go

package main
type Sample struct {
Name string
Foo []string
}
func (s *Sample) foo(j int) {
for i, v := range s.Foo {
println(i, v)
}
}
var samples = []Sample{
Sample{"hello", []string{"world"}},
}
func main() {
samples[0].foo(3)
}
// Output:
// 0 world