This is a created article in which the information may have evolved or changed.
Failure to publish all lost, finished and rewritten again, CSDN have no automatic saving function, strong spit Groove
goThere are two very important environment variables and the GOROOT GOPATH GOROOT installation go path, and GOPATH we define our own workspace.
If the installation is next completed all the way, then the default is configured, no manual configuration.
If you modify the default installation path at the time of installation, you may need to add it yourself.
First add in the environment variable GOPATH , the value go of the installation directory:
Then, in the environment variable, PATH add the go folder under the installation directory bin .
Then add an environment variable GOPATH with the value of your desired working directory.
Finally, restart the command-line tool and enter a go env command to view:
Tips:
Be sure to remember to restart the command-line tool, cmd or cmder what, otherwise the modified environment variable does not take effect, I began to forget the restart, wondering why the half-day did not take effect.