From 3610ef9e4a38834af5d3a3de5449a2f802c3efa7 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Tue, 15 Feb 2022 01:00:00 +0000 Subject: [PATCH] docs(readme): add basic details --- README.md | 51 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e6044aa..b7aaf83 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,49 @@ -# gomockctx +

+ gomockctx +

-Go package with [gomock](https://github.com/golang/mock) helpers for matching -[context.Context](https://pkg.go.dev/context). +

+ + Go package with gomock helpers + for matching context.Context. + +

+ +

+ Go Reference + Actions Status + Coverage + GitHub issues + GitHub pull requests + License Status +

+ +## Import + +```go +import "github.com/romdo/gomockctx" +``` + +## Usage + +```go +// Create a context with a gomockctx ID value. +ctx := gomockctx.New(context.Background()) + +// Match against a context with a gomockctx ID. +someMock.EXPECT(). + Get(gomockctx.Is(ctx), "foo"). + Return("bar", nil) + +// Use context with gomockctx ID when calling function. +someMock.Get(ctx, "foo") +``` + +## Documentation + +Please see the +[Go Reference](https://pkg.go.dev/github.com/romdo/gomockctx#section-documentation). + +## License + +[MIT](https://github.com/romdo/gomockctx/blob/main/LICENSE)