feat: Add SayHello.

Add SayHello function for test.
This commit is contained in:
Yuki 2025-06-14 00:01:56 +08:00
parent a663d56e62
commit 0b8c840f11
Signed by: yuki
GPG Key ID: 0E266240CCAD7A90
3 changed files with 20 additions and 0 deletions

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module hellogomod
go 1.24.4

5
hello.go Normal file
View File

@ -0,0 +1,5 @@
package hellogomod
func SayHello(name string) string {
return "Hello, " + name + "!"
}

12
hello_test.go Normal file
View File

@ -0,0 +1,12 @@
package hellogomod
import "testing"
func TestSayHello(t *testing.T) {
s := SayHello("yuki")
want := "Hello, yuki!"
if s != want {
t.Errorf("return %s, want %s", s, want)
}
}