initial commit
This commit is contained in:
3
hello/go.mod
Normal file
3
hello/go.mod
Normal file
@@ -0,0 +1,3 @@
|
||||
module hello
|
||||
|
||||
go 1.22.1
|
||||
11
hello/hello.go
Normal file
11
hello/hello.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func Hello(name string) string {
|
||||
return "Hello, " + name
|
||||
}
|
||||
|
||||
func main() {
|
||||
fmt.Println(Hello("world"))
|
||||
}
|
||||
12
hello/hello_test.go
Normal file
12
hello/hello_test.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package main
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestHello(t *testing.T) {
|
||||
got := Hello("Chris")
|
||||
want := "Hello, Chris"
|
||||
|
||||
if got != want {
|
||||
t.Errorf("got %q want %q", got, want)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user