mirror of
https://github.com/hanzoai/yaegi.git
synced 2026-10-01 00:49:47 +00:00
* gi: rename gi_c into _gi_c * gi: rename test into _test * gi: fix README syntax
20 lines
213 B
Go
20 lines
213 B
Go
package main
|
|
|
|
type Sample struct {
|
|
Name string
|
|
}
|
|
|
|
var samples = []Sample{}
|
|
|
|
func f(i int) {
|
|
println(samples[i].Name)
|
|
}
|
|
|
|
func main() {
|
|
samples = append(samples, Sample{Name: "test"})
|
|
f(0)
|
|
}
|
|
|
|
// Output:
|
|
// test
|