Skip to content

Instantly share code, notes, and snippets.

@leozz37
Created Oct 16, 2020
Embed
What would you like to do?
Simple Golang Hello World test
package main
import "testing"
func TestHelloWorld(t *testing.T) {
expected := "Hello from Golang!"
result := HelloWorld()
if expected != result {
t.Errorf("HelloWorld was incorrect, got: %s, want: %s.", result, expected)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment