Files
Crimson-Gatekeeper/srv/cmd/tool/lab/pasture/dog.go
des 4cab2f6ff3 更新自定义 DI 注入
我算是明白了,别说 go wire 了,勾八连 GO 这个语言能不能靠得住都挺难说的。既然如此,还是大胆一点吧。俗话说得好,所有让人难绷的细节都是为了宏观上的达成意图的方便。那就来吧。
2026-02-25 08:08:21 +08:00

22 lines
268 B
Go

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}
}