I want to use go modules, after a lot of searching, I just saw some website that said, enable go111module with this command:
GO111MODULE=on
But it's not a path variable, it does not even exist on my pc, so it shows me
GO111MODULE is not recognized as an internal or external command, operable
program, or batch file.
Some people said it's enabled by default on GO v1.16 but it's not working for me, How do I understand it's not working?
I use:
go mod init
and
go get <some_packages>
It adds the new package to my go.mod but my code can't recognize it and I have an "Unresolved dependency" error in my go.mod file.
I use Goland to solve my problem using their GUI's and it solved my problem but their settings just work on the current project and don't work globally.
What can I do? (I'm a Windows 10 user, Go version 1.16)
Answer (Update):
Set a path variable like this by yourself:
After that, run the command:
go env
You will have this line at first line:
set GO111MODULE=on