package pasture type Dog struct { lines string weapon string } func (d *Dog) Sound() string { return d.lines } func (d *Dog) Dangers() bool { if len(d.weapon) == 0 { return false } return true } func NewDog(line string) *Dog { return &Dog{lines: line} }