I'm trying to initialize a new go project with go module (using go 1.11). I don't plan to publish it in github or elsewhere, it is just a temporary/test project with only main package.
Whenever I try to run go mod init
in a directory (that's outside my $GOPATH
), I get this error:
go: cannot determine module path for source directory /Users/... (outside GOPATH, no import comments)
Is it not possible to init module without using git (or other VCS)? Or is there any workaround?