2021-10-01から1ヶ月間の記事一覧
以下のようにチェックできます。 package main import ( "fmt" ) type Animal interface { Eat() } type Human struct { Name string } func (h *Human) Eat() { fmt.Println("eating!!") } func (h *Human) Hello(){ fmt.Printf("Hello, %v", h.Name) } //…
以下のようにチェックできます。 package main import ( "fmt" ) type Animal interface { Eat() } type Human struct { Name string } func (h *Human) Eat() { fmt.Println("eating!!") } func (h *Human) Hello(){ fmt.Printf("Hello, %v", h.Name) } //…