Registry / testing / migueleliasweb-go-github-mock

migueleliasweb-go-github-mock

JSON →
library1.5.0gogounverified

A mock library for testing GitHub API interactions in Go.

go get github.com/migueleliasweb/go-github-mock
INSTALL
IMPORT
SIG · MIGUELELIASWEB-GO-
M
migueleliasweb-go-github-mock
testinggov1.5.0
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.

mock
github.com/migueleliasweb/go-github-mock

Create a mocked GitHub client and simulate a user fetch.

package main import ( "github.com/google/go-github/v45/github" "github.com/migueleliasweb/go-github-mock" ) func main() { mockedHTTPClient := mock.NewMockedHTTPClient( mock.WithRequestMatch( mock.GetUsers, []*github.User{{Login: github.String("octocat")}}, ), ) client := github.NewClient(mockedHTTPClient) user, _, _ := client.Users.Get(ctx, "octocat") fmt.Println(user.GetLogin()) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.5.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
migueleliasweb-go-github-mock — go get migueleliasweb-go-github-mock · libregistry