github.com/h2non/gock

gock

HTTP traffic mocking and testing made easy in Go ༼ʘ̚ل͜ʘ̚༽

80

Decision Signals

Health score 80/100, confidence 95/100.

Strong
Maintenance 38
Adoption 100
Security 92
Maturity 100
Developer DX 97
Confidence 95

Install

go get github.com/h2non/gock

Package Data

updated Jun 11, 2026
Latest versionv1.2.0
Imported by65 packages
Stars2.2K
Forks110
Last activity1 years ago
Latest releasev1.2.0 (3 years ago)
LicenseMIT
Known vuln records0

API Surface

175 symbols
SymbolKindSynopsis
FilterRequestFunc Type type FilterRequestFunc func(*http.Request) bool
FilterResponseFunc Type type FilterResponseFunc func(*http.Response) bool
MapRequestFunc Type type MapRequestFunc func(*http.Request) *http.Request
MapResponseFunc Type type MapResponseFunc func(*http.Response) *http.Response
MatchFunc Type type MatchFunc func(*http.Request, *Request) (bool, error)
Matcher Type type Matcher interface{ ... }
Matcher.Add Method Add func(MatchFunc)
Matcher.Flush Method Flush func()
Matcher.Get Method Get func() []MatchFunc
Matcher.Match Method Match func(*http.Request, *Request) (bool, error)
Matcher.Set Method Set func([]MatchFunc)
Mock Type type Mock interface{ ... }

Maintained Alternatives

limited recent repository activity

#1 Testify

Module testify is a set of packages that provide many tools for testifying that your code will behave as you intend.

Go Testing Libraries 26.0K stars 15 imported-by 100% confidence
95

#2 keploy

Open-source platform for creating safe, isolated production sandboxes for API, integration, and E2E testing.

Go Testing Libraries 17.6K stars 0 imported-by 45% confidence
86

#3 Gomega

Gomega is the Ginkgo BDD-style testing framework's preferred matcher library.

Go Testing Libraries 0 stars 11.8K imported-by 80% confidence
80

Similar Packages

Go Testing Libraries

#1 Testify

Module testify is a set of packages that provide many tools for testifying that your code will behave as you intend.

Go Testing Libraries 26.0K stars 15 imported-by 100% confidence
95

#2 keploy

Open-source platform for creating safe, isolated production sandboxes for API, integration, and E2E testing.

Go Testing Libraries 17.6K stars 0 imported-by 45% confidence
86

#3 Gomega

Gomega is the Ginkgo BDD-style testing framework's preferred matcher library.

Go Testing Libraries 0 stars 11.8K imported-by 80% confidence
80

#4 testcase

Package testcase is an opinionated testing framework.

Go Testing Libraries 130 stars 0 imported-by 65% confidence
71

#5 hoverfly

Lightweight service virtualization/ API simulation / API mocking tool for developers and testers

Go Testing Libraries 0 stars 0 imported-by 60% confidence
59