Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment configuration error #36594

Closed
keienatinb opened this issue Jan 16, 2020 · 4 comments
Closed

Environment configuration error #36594

keienatinb opened this issue Jan 16, 2020 · 4 comments

Comments

@keienatinb
Copy link

What version of Go are you using (go version)?

go version go1.13.4 windows/amd64

What operating system and processor architecture are you using (go env)?

windows and ubuntu16:04

go env Output
$ go env

I want to set GO111MODULE = auto,But I wrote auto as AUTO
image

then
image

image

I don't know how can I reset GO111MODULE.

@beoran
Copy link

beoran commented Jan 16, 2020

Since this is on Windows, you can edit the environment variables as described here for GOPATH:
https://github.com/golang/go/wiki/SettingGOPATH#windows
Please note that this issue tracker is not for asking questions, please see here:
https://github.com/golang/go/wiki/Questions

@keienatinb
Copy link
Author

由于这是在Windows上,因此您可以按照以下针对GOPATH的 说明来编辑环境变量:
https : //github.com/golang/go/wiki/SettingGOPATH#windows
请注意,此问题跟踪程序并非用于询问问题,请在此处查看:https :
//github.com/golang/go/wiki/Questions

I'm so sorry,I also encountered this problem using ubuntu 16:04,Also, I restarted the cmd window, but the problem persists。

@ALTree
Copy link
Member

ALTree commented Jan 16, 2020

Thanks for the report.

You hit #34880, which was recently fixed (fix will be included in go1.14). The problem is that if you set a bad GO111MODULE with go env -w, the go command itself becomes unusable.

In the meantime, you could try this:

First, manually set GO111MODULE to a correct value from the terminal, for example in powershell; that should temporarily fix go env, then you can try go env -w again, so run:

$env:GO111MODULE=off

and then:

go env -w GO111MODULE=off

Does that work?

@keienatinb
Copy link
Author

感谢您的报告。

您点击了#34880,该问题最近已得到修复(修复将包含在go1.14中)。问题是,如果使用go env -w设置了错误的GO111MODULE,则go命令本身将无法使用。

在此期间,您可以尝试以下操作:

首先,从端子(例如在powershell中)手动将GO111MODULE设置为正确的值;应该可以临时修复go env,然后您可以尝试go env -w again,运行:

$env:GO111MODULE=off

接着:

go env -w GO111MODULE=off

那样有用吗?

Thank you for your reply, I have solved this problem by manually configuring the environment variables
export GO111MODULE=auto

@golang golang locked and limited conversation to collaborators Jan 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants