go env

go env -u NAME 可以把 go env -w NAME=VALUE设置的环境变量给重置

具体可以通过 go help env查看

$ go help env
usage: go env [-json] [-u] [-w] [var ...]

Env prints Go environment information.

By default env prints information as a shell script
(on Windows, a batch file). If one or more variable
names is given as arguments, env prints the value of
each named variable on its own line.

The -json flag prints the environment in JSON format
instead of as a shell script.

The -u flag requires one or more arguments and unsets
the default setting for the named environment variables,
if one has been set with 'go env -w'.

The -w flag requires one or more arguments of the
form NAME=VALUE and changes the default settings
of the named environment variables to the given values.

For more about environment variables, see 'go help environment'.

翻译:

用法:去 env [-json] [-u] [-w] [var ...]

Env 打印 Go 环境信息。

默认情况下,env 将信息打印为 shell 脚本
(在 Windows 上,一个批处理文件)。 如果一个或多个变量
名称作为参数给出, env 打印的值
每个命名变量都在自己的行上。

-json 标志以 JSON 格式打印环境
而不是作为 shell 脚本。

-u 标志需要一个或多个参数并取消设置
命名环境变量的默认设置,
如果已经设置了“go env -w”。

-w 标志需要一个或多个参数
形成 NAME=VALUE 并更改默认设置
命名环境变量的给定值。

有关环境变量的更多信息,请参阅“go help environment”。


版权声明:本文为wangchao701123原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。