更新自定义 DI 注入
我算是明白了,别说 go wire 了,勾八连 GO 这个语言能不能靠得住都挺难说的。既然如此,还是大胆一点吧。俗话说得好,所有让人难绷的细节都是为了宏观上的达成意图的方便。那就来吧。
This commit is contained in:
13
srv/cmd/tool/lab/pasture/sheep.go
Normal file
13
srv/cmd/tool/lab/pasture/sheep.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package pasture
|
||||
|
||||
type Sheep struct {
|
||||
lines string
|
||||
}
|
||||
|
||||
func (s *Sheep) Sound() string {
|
||||
return s.lines
|
||||
}
|
||||
|
||||
func NewSheep(line string) *Sheep {
|
||||
return &Sheep{lines: line}
|
||||
}
|
||||
Reference in New Issue
Block a user