Skip to content

Instantly share code, notes, and snippets.

@ramadani
Created July 16, 2018 09:30
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 ramadani/614a767e9e646cbd85b493ecacfbf3d0 to your computer and use it in GitHub Desktop.
Save ramadani/614a767e9e646cbd85b493ecacfbf3d0 to your computer and use it in GitHub Desktop.
Snippet from Circle Test Code
package circle
import (
"testing"
)
func TestArea(t *testing.T) {
circle := Circle{Radius: 10}
expected := 314.1592653589793
actual := circle.Area()
if actual != expected {
t.Errorf("TestArea failed, expected: '%.2f', got: '%.2f'", expected, actual)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment