wolfbash.hateblo.jp ãã®è¨äºã§å¾åãã«ãã¦ããç¶æ¿é¨åã«ã¤ãã¦æ¸ãã¾ãã golang ã¯ç¶æ¿ããªãï¼ãªãã¦ãã¨è¨ã£ã¦ãã¾ãããããã¾ãããæ§é ä½ã«å¯¾ããåè¾¼ã§å¯è½ã«ãªãã¾ãã package main import "fmt" type Parent struct { name string } func (p Parent) Print() { fmt.Println("Parent->Print:", p.name) } type Child struct { Parent } func main() { p := Parent{ "PARENT" } c := Child{ Parent{ "CHILD" } } p.Print() // Parent->Print: PARENT c.Print() // Parent->Print: CHILD } Pare
{{#tags}}- {{label}}
{{/tags}}