Skip to content

Instantly share code, notes, and snippets.

@leozz37
Created October 16, 2020 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leozz37/9f453859938828ac6f496c78f4442b7d to your computer and use it in GitHub Desktop.
Save leozz37/9f453859938828ac6f496c78f4442b7d to your computer and use it in GitHub Desktop.
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