https://github.com/0xch4z/tenv
Golang wrapper to set/unset temporary environment variables for testing
https://github.com/0xch4z/tenv
golang testing
Last synced: 11 months ago
JSON representation
Golang wrapper to set/unset temporary environment variables for testing
- Host: GitHub
- URL: https://github.com/0xch4z/tenv
- Owner: 0xch4z
- License: mit
- Created: 2019-08-01T00:17:51.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-08-01T14:11:48.000Z (almost 7 years ago)
- Last Synced: 2025-06-15T18:19:58.359Z (about 1 year ago)
- Topics: golang, testing
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tenv [![Build Status][travis-ci-badge]][travis-ci] [![GoDoc][godoc-badge]][godoc]
> Set/unset temporary environment variables for testing
## Installation
```sh
go get github.com/charliekenney23/tenv
```
## Usage
```go
{
c := tenv.New()
defer c.Restore()
c.Set("foo", "bar")
c.Unset("baz")
} // environment restored to initial state
```
© 2019 [Charles Kenney](https://github.com/charliekenney23)
[travis-ci-badge]: https://travis-ci.org/Charliekenney23/tenv.svg?branch=master
[travis-ci]: https://travis-ci.org/Charliekenney23/tenv
[godoc-badge]: https://godoc.org/github.com/Charliekenney23/tenv?status.svg
[godoc]: https://godoc.org/github.com/Charliekenney23/tenv