https://github.com/newmo-oss/testid
testid provides utilities of test id for unit testing of Go
https://github.com/newmo-oss/testid
golang testing
Last synced: over 1 year ago
JSON representation
testid provides utilities of test id for unit testing of Go
- Host: GitHub
- URL: https://github.com/newmo-oss/testid
- Owner: newmo-oss
- License: mit
- Created: 2024-09-13T12:39:35.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-10T06:38:22.000Z (over 1 year ago)
- Last Synced: 2025-03-10T07:29:32.186Z (over 1 year ago)
- Topics: golang, testing
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# testid [](https://pkg.go.dev/github.com/newmo-oss/testid)[](https://goreportcard.com/report/github.com/newmo-oss/testid)
testid provides utilities of test id for unit testing of Go.
## Usage
```go
package a_test
import (
"context"
"testing"
"github.com/google/uuid"
"github.com/newmo-oss/newmotime"
"github.com/newmo-oss/newmotime/newmotimetest"
"github.com/newmo-oss/testid"
)
func Test(t *testing.T) {
tid := uuid.NewString()
ctx := testid.WithValue(context.Background(), tid)
now := newmotime.Now(ctx)
newmotimetest.SetFixedNow(t, ctx, now)
}
```
## License
MIT