feat: Add SayHello.
Add SayHello function for test.
This commit is contained in:
parent
a663d56e62
commit
0b8c840f11
5
hello.go
Normal file
5
hello.go
Normal file
@ -0,0 +1,5 @@
|
||||
package hellogomod
|
||||
|
||||
func SayHello(name string) string {
|
||||
return "Hello, " + name + "!"
|
||||
}
|
||||
12
hello_test.go
Normal file
12
hello_test.go
Normal 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)
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user