Installing local packages to GOPATH

Hello Everyone,

Hope all is well in these difficult times. I have been trying to install a local package (located on my system’s filesystem) into GOPATH and it just does not work.

I am using go modules (go mod init). I cd into my project directory and then run the following command go install test.com/username/project but my package does not get placed into $GOPATH/src

Am I missing something? Any thoughts, comments, or ideas would be much appreciated.

Best,
thegopher

go commands run within a module, will not have the sideeffect of poluting your GOPATH, they work on “sandbox” that is “private” to your module.