mirror of
https://github.com/traefik/yaegi.git
synced 2026-06-01 18:37:56 +00:00
24 lines
235 B
Go
24 lines
235 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
type Myint int
|
|
|
|
func (i Myint) Double() { fmt.Println("Myint:", i, i) }
|
|
|
|
type Boo interface {
|
|
Double()
|
|
}
|
|
|
|
func f(boo Boo) {
|
|
boo.Double()
|
|
}
|
|
|
|
func main() {
|
|
var i Myint = 3
|
|
f(i)
|
|
}
|
|
|
|
// Output:
|
|
// Myint: 3 3
|