GO111MODULE and GOPATH

Home Forums Go Programming GO111MODULE and GOPATH

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #5467 Reply
    Humble
    Keymaster

    When GO111MODULE=off, the go get command simply clones the package from the master repository of the package and puts it inside $GOPATH/src. If GO111MODULE=on, then go get command puts the package code inside a separate directory and it supports versioning.

    From Go 1.13, GO111MODULE is set to auto by default which means go get command inside GOPATH will act as if GO111MODULE=off and when it is invoked outside GOPATH, it will act as if GO111MODULE=on.

    You can use GO111MODULE=on go get <package>@<version> command to set the GO111MODULE environment variable in the command execution.

    #5471 Reply
    Humble
    Keymaster
    This reply has been marked as private.
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: GO111MODULE and GOPATH
Your information: