Commit 5cd525a
Changed files (2)
hello.go
@@ -2,10 +2,10 @@ package main
import "fmt"
-func Hello() string {
- return "Hello, world"
+func Hello(name string) string {
+ return "Hello, " + name
}
func main() {
- fmt.Println(Hello())
+ fmt.Println(Hello("world"))
}
hello_test.go
@@ -3,8 +3,8 @@ package main
import "testing"
func TestHello(t *testing.T) {
- got := Hello()
- want := "Hello, world"
+ got := Hello("mo")
+ want := "Hello, mo"
if got != want {
t.Errorf("got %q want %q", got, want)