Created
December 27, 2015 20:44
-
-
Save yosmoc/6b89f8c0e42ea3a84c34 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package hello | |
import "fmt" | |
func Hello(user string) string { | |
hello := "hello " + user | |
fmt.Println(hello) | |
return hello | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package hello | |
import "testing" | |
func TestHello(t *testing.T) { | |
const user, expected = "samurai20000", "hello samurai20000" | |
result := Hello(user) | |
if result != expected { | |
t.Errorf("Hello(%v)=%v expected: %v", user, result, expected) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment