cfg

package
v0.0.0-...-a7e320e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const KnownEnv = `` /* 577-byte string literal not displayed */

Variables

View Source
var (
	GOROOT = BuildContext.GOROOT
	GOBIN  = Getenv("GOBIN")

	BuildContext = build.Default

	BuildV bool // -v flag

	ModFile string // -modfile flag

	CmdName string // "build", "install", "list", "mod tidy", etc
)
View Source
var CmdEnv []EnvVar

CmdEnv是运行go-tool命令的新环境。 用户二进制文件(在go test或go run期间)使用OrigEnv运行, 不是CmdEnv。

View Source
var OrigEnv []string

OrigEnv is the original environment of the program at startup. OrigEnv是程序启动时的原始环境。

Functions

func CanGetenv

func CanGetenv(key string) bool

判断传入的 key 是否在env中存在

func EnvFile

func EnvFile() (string, error)

EncFile返回 Go 环境配置文件路径

func EnvFle

func EnvFle() (string, error)

EnvFile returns the name of the Go environment configuration file. EnvFile返回Go环境配置文件的名称

func Getenv

func Getenv(key string) string

Types

type EnvVar

type EnvVar struct {
	Name  string
	Value string
}

An EnvVar is an environment variable Name=Value. 一个An EnvVar 是一个环境变量Name=Value。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL