https://github.com/lufia/plug
Package plug replaces functions, defined in the other packages, on testing.
https://github.com/lufia/plug
go
Last synced: 9 months ago
JSON representation
Package plug replaces functions, defined in the other packages, on testing.
- Host: GitHub
- URL: https://github.com/lufia/plug
- Owner: lufia
- License: bsd-3-clause
- Created: 2024-05-18T10:18:36.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-16T13:04:57.000Z (over 1 year ago)
- Last Synced: 2025-09-27T00:30:21.709Z (9 months ago)
- Topics: go
- Language: Go
- Homepage:
- Size: 75.2 KB
- Stars: 16
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# plug
Package plug replaces functions, defined in the other packages, on testing.
The idea underlying this library was heavy inspired from [tenntenn/testtime][testtime].
[![GoDev][godev-image]][godev-url]
## Usage
See [examples](https://github.com/lufia/plug/blob/main/test/example_test.go).
```sh
go test -overlay <(go run github.com/lufia/plug/cmd/plug@latest)
```
Then add below to **.gitignore**
```txt
plug
```
## Limitations
* cyclic import: runtime, reflect, etc.
* **go:linkname** functions: *time.Sleep*, etc.
[godev-image]: https://pkg.go.dev/badge/github.com/lufia/plug
[godev-url]: https://pkg.go.dev/github.com/lufia/plug
[testtime]: https://github.com/tenntenn/testtime