Created
May 4, 2020 08:05
-
-
Save mprokopov/6a23d0a03c5d4fdbda62bcc33ad16116 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // main.go | |
| func SimpleFactory (host string) Simple { | |
| return Simple{"Hello", "World", host} | |
| } | |
| // main_test.go | |
| import "testing" | |
| func TestSimpleFactory(t *testing.T) { | |
| f := SimpleFactory("http://localhost") | |
| if f.Url != "http://localhost" { | |
| t.Errorf("feature incorrect, got %s, want: %s ", f.Url, "http://localhost") | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment