Files
moxa/_test/interface8.go

26 lines
259 B
Go

package main
import (
"fmt"
)
var _ = (HelloInterface)((*Hello)(nil))
type HelloInterface interface {
Hi() string
}
type Hello struct{}
func (h *Hello) Hi() string {
return "hi"
}
func main() {
h := &Hello{}
fmt.Println(h.Hi())
}
// Output:
// hi