commit 1271ceeee7ccbe6b2e8c6d597a0d58944babc780 Author: des <18638715007@163.com> Date: Fri Mar 6 00:07:44 2026 +0800 初始化捏 diff --git a/bluePrint.go b/bluePrint.go new file mode 100644 index 0000000..67ceb13 --- /dev/null +++ b/bluePrint.go @@ -0,0 +1,14 @@ +package lab + +import ( + "github.com/zire" +) + +type Application struct{} + +func (a *Application) start() {} + +func test() { + app := zire.Karmaforge[Application]() + app.start() +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..aaa6b39 --- /dev/null +++ b/go.mod @@ -0,0 +1,11 @@ +module example + +go 1.25 + +require ( + github.com/zire v0.0.0 +) +replace ( + github.com/zire v0.0.0 => /home/nobara/projects/zire +) + diff --git a/interface.go b/interface.go new file mode 100644 index 0000000..0e726f3 --- /dev/null +++ b/interface.go @@ -0,0 +1,5 @@ +package lab + +type Animal interface { + sound() string +} diff --git a/main.go b/main.go new file mode 100644 index 0000000..44a96af --- /dev/null +++ b/main.go @@ -0,0 +1,3 @@ +package lab + +func main() {} diff --git a/pasture/dog.go b/pasture/dog.go new file mode 100644 index 0000000..5c62e63 --- /dev/null +++ b/pasture/dog.go @@ -0,0 +1,21 @@ +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} +} diff --git a/pasture/sheep.go b/pasture/sheep.go new file mode 100644 index 0000000..3885458 --- /dev/null +++ b/pasture/sheep.go @@ -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} +}