golang unexpected directory layout
See GitHub code layout
$GOPATH
is the root of the project - each of your Github repos will be checked out several folders below$GOPATH
.
Your$GOPATH
variable will point to the root of your Go workspace, as described in How to Write Go Code.
In your case, below your GOPATH
folder, you should have
src/github.com/minio/minio
Anf only then "all minio directories, including vendor"
On Golang 1.13 it suddenly happened to me on all my code after upgrading from 1.11 to 1.13.
It seems golang 1.13 does not like anymore imports like "./something".
I had to develop any import like "myapp/something"
This can happen if you have duplicate repos under goroot AND gopath. Delete the goroot one.
Also with go1.13 (with the move to go mod), I found if I moved my project out from under my $GOPATH, I could use the import "./mypackage" statement. The same project under $GOPATH wouldn't build with the errors given by the OP above. I'm not ready to give up my $GOPATH environment variable just yet but I do like to keep small packages local to their project when possible, without committing to a go.mod file when it's not necessary.