·
#include __FILE__

使用 PowerShell 永久修改环境变量 - 知乎 (zhihu.com)给你个链接吧,可以用powershell改env,评论里还有个其他的点如果涉及可以参考一下

或者直接用go提供的命令(永久修改),如go env -w GO111MODULE=on,修改的是GOENV的文件

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'.
Replies
1

感谢补充