How to use the moudle function of golang version 1.11?

I turned on the moudle function in the environment variable


Jan.15,2022

Don't change it yourself. It is automatically identified. When your project directory has go.mod, it will automatically enable
refer to this article: https://www.jianshu.com/p/c57.


Amway justforfunc https://www.youtube.com/chann.-sharp42-sharp43 period is all about the use of go modules.

personal experience: go module is much easier to manage than the previously used gvt ~

you have set up GO111MODULES=on, here, which means you need to have a go.mod file in the root directory of your project, and that's what your error report means. As for what you said about go mod init, it doesn't work? What is the wrong report?

my guess is that you are outside gopath and your project is not managed by VCS. If so, the solution is:

// module
go mod init MODULE_NAME

you can generate a go.mod file

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5b563-45635.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5b563-45635.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?