28/2 mixture of field:value and value initializers error in Go
I was studying that is-a relationship about embeding. But example was not working below refer. refer : https://up-to-date-items.tistory.com/114 package main import "fmt" type Player struct { salary int } type Pro struct { Player bonus int } func (p Player) getSalary() int { return p.salary } func main() { player1 := Player{salary: 100} proPlayer := Pro{Player{salary: 120}, bonus: 30} fmt.Println..
Go/Study record
2022. 2. 28. 17:46