mirror of
https://github.com/traefik/yaegi.git
synced 2026-06-01 18:37:56 +00:00
* gi: rename gi_c into _gi_c * gi: rename test into _test * gi: fix README syntax
21 lines
223 B
Go
21 lines
223 B
Go
package main
|
|
|
|
type Sample struct {
|
|
Name string
|
|
}
|
|
|
|
func (s Sample) foo(i int) {
|
|
println("in foo", s.Name, i)
|
|
}
|
|
|
|
var samples = []Sample{
|
|
Sample{"hello"},
|
|
}
|
|
|
|
func main() {
|
|
samples[0].foo(3)
|
|
}
|
|
|
|
// Output:
|
|
// in foo hello 3
|