Skip to content

Instantly share code, notes, and snippets.

@yosmoc
Created December 27, 2015 20:44
Show Gist options
  • Save yosmoc/6b89f8c0e42ea3a84c34 to your computer and use it in GitHub Desktop.
Save yosmoc/6b89f8c0e42ea3a84c34 to your computer and use it in GitHub Desktop.
package hello
import "fmt"
func Hello(user string) string {
hello := "hello " + user
fmt.Println(hello)
return hello
}
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