Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: unexpected directory layout while building project #33752

Closed
scrumteamravens opened this issue Aug 21, 2019 · 4 comments
Closed

cmd/go: unexpected directory layout while building project #33752

scrumteamravens opened this issue Aug 21, 2019 · 4 comments

Comments

@scrumteamravens
Copy link

@scrumteamravens scrumteamravens commented Aug 21, 2019

    unexpected directory layout:
    	import path: github.com/gruntwork-io/terratest/modules/helm
    	root: /home/vagrant/go/src
    	dir: /home/vagrant/go/src/k8stests/vendor/github.com/gruntwork-io/terratest/modules/helm
    	expand root: /home/vagrant/go/src
    	expand dir: /home/vagrant/go/src/k8stests/vendor/github.com/gruntwork-io/terratest/modules/helm
    	separator: /

Can you please help me on where i am going wrong here.

$ go env

    GOARCH="amd64"
    GOBIN=""
    GOCACHE="/home/vagrant/.cache/go-build"
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="linux"
    GOOS="linux"
    GOPATH="/home/vagrant/go:/home/vagrant/go/src/k8stests"
    GORACE=""
    GOROOT="/usr/lib/go-1.10"
    GOTMPDIR=""
    GOTOOLDIR="/usr/lib/go-1.10/pkg/tool/linux_amd64"
    GCCGO="gccgo"
    CC="gcc"
    CXX="g++"
    CGO_ENABLED="1"
    CGO_CFLAGS="-g -O2"
    CGO_CPPFLAGS=""
    CGO_CXXFLAGS="-g -O2"
    CGO_FFLAGS="-g -O2"
    CGO_LDFLAGS="-g -O2"
    PKG_CONFIG="pkg-config"
    GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build737322677=/tmp/go-build -gno-record-gcc-switches"

go version go1.10.4 linux/amd64

@smasher164 smasher164 changed the title unexpected directory layout while building project. cmd/go: unexpected directory layout while building project Aug 21, 2019
@smasher164

This comment has been minimized.

Copy link
Member

@smasher164 smasher164 commented Aug 21, 2019

Can you provide the exact commands you ran to fetch and build this package?

@scrumteamravens

This comment has been minimized.

Copy link
Author

@scrumteamravens scrumteamravens commented Aug 22, 2019

in the project root directory /home/vagrant/go/src/k8stests
go build ...

@agnivade

This comment has been minimized.

Copy link
Contributor

@agnivade agnivade commented Aug 22, 2019

Since you are using Go 1.10, you need to do everything according to the GOPATH. First of all, you have an incorrect GOPATH setting. There is no need to append /home/vagrant/go/src/k8stests to /home/vagrant/go. Just /home/vagrant/go is fine. And secondly, clone your repo under the correct path. If you are building github.com/gruntwork-io/terratest, create that folder structure under home/vagrant/go/src and then clone the repo there and build it.

Please see this answer - https://stackoverflow.com/questions/45428744/golang-unexpected-directory-layout.

I will go ahead and close this since this is not a bug. If this still does not solve your issue please feel free to ask it in any of these forums below:

Thanks

@agnivade agnivade closed this Aug 22, 2019
@scrumteamravens

This comment has been minimized.

Copy link
Author

@scrumteamravens scrumteamravens commented Aug 26, 2019

@agnivade Its working fine if i pull the dependency using "go get" but as soon as i move to godep to resolve dependency it pulls everything in vendor folder but while building my project it shows " unexpected directory layout" . Not sure where i went wrong.
As per your suggestion i changed the GOPATH to "/home/vagrant/go" still no luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.