gf: github.com/gogf/gf/g/os/genv Index | Files

package genv

import "github.com/gogf/gf/g/os/genv"

Package genv provides operations for environment variables of system.

Index

Package Files

genv.go

func All Uses

func All() []string

All returns a copy of strings representing the environment, in the form "key=value".

func Get Uses

func Get(key string, def ...string) string

Get returns the value of the environment variable named by the <key>. It returns given <def> if the variable does not exist in the environment.

func Remove Uses

func Remove(key string) error

Remove deletes a single environment variable.

func Set Uses

func Set(key, value string) error

Set sets the value of the environment variable named by the <key>. It returns an error, if any.

Package genv imports 1 packages (graph) and is imported by 2 packages. Updated 2019-06-20. Refresh now. Tools for package owners.