Skip to content
forked from adammck/venv

Golang library to abstract and mock ENV access

License

Notifications You must be signed in to change notification settings

georgettica/venv

This branch is 52 commits ahead of adammck/venv:master.

Folders and files

NameName
Last commit message
Last commit date
Aug 15, 2023
Jun 10, 2020
Jun 10, 2020
Dec 2, 2021
Dec 3, 2021
Jun 3, 2020
Dec 2, 2021
Dec 2, 2021
Dec 3, 2021
Jun 2, 2023
Jun 2, 2023
Dec 2, 2021
Dec 2, 2021
Dec 2, 2021

Repository files navigation

venv

GoDoc

This is a Go library to abstract access to environment variables.
Like [spf13/afero][afero] or [blang/vfs][vfs], but for the env.

Usage

package main

import (
	"fmt"
	"github.com/georgettica/venv"
)

func main() {
	var e venv.Env

	// Use the real environment

	e = venv.OS()
	fmt.Printf("Hello, %s!\n", e.Getenv("USER"))

	// Or use a mock

	e = venv.Mock()
	e.Setenv("USER", "fred")
	fmt.Printf("Hello, %s!\n", e.Getenv("USER"))
}

License

MIT.

About

Golang library to abstract and mock ENV access

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 86.6%
  • Makefile 13.4%