. Advertisement .
..3..
. Advertisement .
..4..
I am working on programs, but I found the following warning message:
go: go.mod file not found in current directory or any parent directory; see 'go help modules'
Is there any way to stabilize the issue “go.mod file not found in current directory”? I read a lot of topics about this, but all of them were trying to install anything. Is this the correct way, or any recommendation for me? Please find the beginning command below:
GO111MODULE=on
GOPROXY=https://proxy.golang.org,direct
This can be changed:
go env -w GO111MODULE=auto
This:
go env -w GO111MODULE=off
Yes, simply follow the guide. To create a module, you can the command go mod init test3. No one else has upgraded from the previous version, or maybe everyone else just got it right.
Or there is another way for you to resolve this problem:
Make sure that “auto” is set for the value of your GO111MODULE first. Then check it by using the below command:
In the case, it isn’t set ”auto” condition, let’s run:
Then access to your work directory which in the terminal and run this:
Subsequently, your program will work fine.