Created
November 14, 2020 16:01
-
-
Save johnnyb/e9018d0403c9a29afebe7b1ed431b5a2 to your computer and use it in GitHub Desktop.
Go Testing
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
var GetDatabaseInfo = func(indata string) string { | |
// Do database stuff here | |
} | |
func TestRequest(t *testing.T) { | |
// Replace our database access function here | |
GetDatabaseInfo = func(indata string) { | |
return "testingresult" | |
} | |
// Do request processing here | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment