Registry / testing / jarcoal-httpmock-v1

jarcoal-httpmock-v1

JSON →
library1.0.0-20190314184232-a8ac0a50d0b5gogounverified

A Go library for mocking HTTP responses in tests.

go get gopkg.in/jarcoal/httpmock.v1
INSTALL
IMPORT
SIG · JARCOAL-HTTPMOCK-V
J
jarcoal-httpmock-v1
testinggov1.0.0-20190314184232-a8ac0a50d0b5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

httpmock
gopkg.in/jarcoal/httpmock.v1

Register a mock HTTP responder.

package main import ( "fmt" "gopkg.in/jarcoal/httpmock.v1" ) func main() { httpmock.Activate() defer httpmock.DeactivateAndReset() httpmock.RegisterResponder("GET", "http://example.com", httpmock.NewStringResponder(200, "OK")) fmt.Println("Mock registered") }
Debug
Known issues
gotchaVersion v1 uses gopkg.in; ensure you import the correct version.
fix
Use gopkg.in/jarcoal/httpmock.v1 for v1.x releases.
affects: >=1.0.0
Upgrade
Version history
1.0.0-20190314184232-a8ac0a50d0b5latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Perplexity
1
Resources
jarcoal-httpmock-v1 — go get jarcoal-httpmock-v1 · libregistry