feat: complete handling of switch case statements (#88)
This commit is contained in:
committed by
Ludovic Fernandez
parent
6d21cefe75
commit
ef83e43bd7
31
_test/interface3.go
Normal file
31
_test/interface3.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
type fii interface {
|
||||
Hello()
|
||||
}
|
||||
|
||||
type Boo struct {
|
||||
Name string
|
||||
}
|
||||
|
||||
func (b Boo) Hello() {
|
||||
fmt.Println("Hello", b)
|
||||
fmt.Println(b.Name)
|
||||
}
|
||||
|
||||
func inCall(foo fii) {
|
||||
fmt.Println("inCall")
|
||||
foo.Hello()
|
||||
}
|
||||
|
||||
func main() {
|
||||
boo := Boo{"foo"}
|
||||
inCall(boo)
|
||||
}
|
||||
|
||||
// Output:
|
||||
// inCall
|
||||
// Hello {foo}
|
||||
// foo
|
||||
Reference in New Issue
Block a user