package
0.0.0-20240514053209-5f25c38e1f34
Repository: https://github.com/permafrost-dev/eget.git
Documentation: pkg.go.dev
# Functions
No description provided by the author
Utility function to create a mock HTTP response.
# Structs
No description provided by the author
No description provided by the author
- * *
// basic usage example (in some_file_test.go):
client = mockhttp.NewMockHTTPClient()
client.DoFunc = func(req *http.Request) (*http.Response, error) {
//
}
client.AddJSONResponse("https://api.github.com/repos/testRepo/releases/v1.0.0", `{"tag_name": "v1.0.0", "prerelease": false, "assets": [{"name": "exampleTool.tar.gz", "browser_download_url": "https://github.com/example/repo/tarball/v1.0.0/exampleTool.tar.gz"}], "created_at": "2020-01-01T00:00:00Z"}`, 200)
*/.