From 1271ceeee7ccbe6b2e8c6d597a0d58944babc780 Mon Sep 17 00:00:00 2001 From: des <18638715007@163.com> Date: Fri, 6 Mar 2026 00:07:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E6=8D=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bluePrint.go | 14 ++++++++++++++ go.mod | 11 +++++++++++ interface.go | 5 +++++ main.go | 3 +++ pasture/dog.go | 21 +++++++++++++++++++++ pasture/sheep.go | 13 +++++++++++++ 6 files changed, 67 insertions(+) create mode 100644 bluePrint.go create mode 100644 go.mod create mode 100644 interface.go create mode 100644 main.go create mode 100644 pasture/dog.go create mode 100644 pasture/sheep.go 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} +}