当未定义$ GOPATH时,如何查找安装有'go get -u'的Go软件包?

I'm following the gRPC Quickstart tutorial for Go, https://grpc.io/docs/quickstart/go/, and have installed gRPC using the command

go get -u google.golang.org/grpc

I actually haven't defined a GOPATH environment variable:

> echo $GOPATH

which, as I understand it, means that it defaults to ~/go, or in my case /Users/kurt/go.

At the next step, I'd like to build the example by doing

cd $GOPATH/src/google.golang.org/grpc/examples/helloworld

However, I find that the directory doesn't exist, and there is also no google.golang.org directory in /Users/kurt/go/src:

~/g/src> ls *google*
fish: No matches for wildcard '*google*'. See `help expand`.
ls *google*
   ^

Should the package not be located here? That's what I understand from Where does go get install packages?.

Using Go Modules, you can find 'go get' downloaded files at:

~/go/pkg/mod/cache/download

However, it should be treated like an immutable copy of the source code.

If you want a mutable copy of the source code, you should clone the repository:

git clone https://github.com/grpc/grpc-go

In your example output, you are in ~/g/arc

Go path default would be ~/go/src

I think auto complete bit ya there

In the end, I worked around the problem by cloning https://github.com/grpc/grpc-go which appears to contain the examples/helloworld directory I'm looking for. Still curious to hear where the package downloaded with go get is located.