Please answer these questions before submitting your issue. Thanks!
go version
)?go version go1.8.1 darwin/amd64
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/aaronmichaels/Developer/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.8.1/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.8.1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/hm/nb7xhr9961v06dsc9jsm95m80000gn/T/go-build516539570=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
I used the glide tool (https://github.com/Masterminds/glide
) to install a dependency (github.com/appliedgo/perceptron/draw
) at /Users/aaronmichaels/Developer/go/src/github.com/ajmichaels/misc/appliedgo/perceptron.
Under this directory, I have a glide.yaml file, a glide.lock file, a main.go file, and a vendor/ folder. Within the main.go file, I have "github.com/appliedgo/perceptron/draw"
imported. However, when I try to go build my main.go file, I get this error:
main.go:8:2: cannot find package "github.com/appliedgo/perceptron/draw" in any of:
/usr/local/Cellar/go/1.8.1/libexec/src/github.com/appliedgo/perceptron/draw (from $GOROOT)
/Users/aaronmichaels/Developer/go/src/github.com/appliedgo/perceptron/draw (from $GOPATH)
My gopath is /Users/aaronmichaels/Developer/go
, so the error is not related to not being within my gopath. Also, projects with dependencies installed via go get
work fine.
From what I've seen online, the go build command should have run with no errors.
For questions about Go, see https://golang.org/wiki/Questions.
Hi @bradfitz I'm not asking a question, this is a bug report.
Please start with the mailing list. This looks like user error instead of a clear bug report.
If you have a problem with glide, please file a bug report against glide.
@bradfitz I will ask on the mailing list, but I consulted with the go-nuts irc channel and it looks like a bug. Also https://github.com/golang/go/issues/19916 seems to a similar (same?) bug. The issue is not with glide, it is with golang not detecting that a vendor folder is present
How do I make it look like a bug report instead of a question?
The mailing list can help solve your problem and/or help you file a bug report.
But in general, we don't have the resources to help debug external tools.
This is probably the same as https://github.com/golang/go/issues/15628 since vendoring has never really worked with gccgo AFAIK. I just posted a CL in that issue to fix the problem when using the go tool built for gccgo (not golang yet).
Another suggestion is for you to explicitly add the -I option(s) to your GCCGOFLAGS to identify the vendor paths of the missing packages.
when has multi GOPATH, It can`t detect the vendor folder.
go env
....
GOPATH="/go/codes/path1:/go/codes/path2"
....
Hi @ajmichaels ,
github.com/appliedgo/perceptron/draw
is what you intend to import, but in src
folder your pkg is github.com/ajmichaels/misc/appliedgo/perceptron
.
Note "misc".
Most helpful comment
How do I make it look like a bug report instead of a question?