An open API service indexing awesome lists of open source software.

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.

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