1

I am new to Go, and I have been working on a Go project locally. I have installed Godep in my local system by:

go get github.com/tools/godep

and then installed Aerospike dependency

go get -u github.com/aerospike/aerospike-client-go

However $GOPATH/bin/godep save ./... gives me following error:-

godep: [WARNING]: godep should only be used inside a valid go package directory and
godep: [WARNING]: may not function correctly. You are probably outside of your $GOPATH.
godep: [WARNING]:   Current Directory: /Users/XYZ/go_code/labs-audience
godep: [WARNING]:   $GOPATH: /Users/XYZ/go_code
godep: WARNING: Godep workspaces (./Godeps/_workspace) are deprecated and support for them will be removed when go1.8 is released.
godep: WARNING: Go version (go1.6) & $GO15VENDOREXPERIMENT= wants to enable the vendor experiment, but disabling because a Godep workspace (Godeps/_workspace) exists
godep: WARNING: Recorded major go version (go1.5) and in-use major go version (go1.6) differ.
godep: To record current major go version run `godep update -goversion`.

It truncates my Godeps/Godeps.json and Godeps/_workspace/ directory. Please not that I am not panning to upgrade project Go version to 1.6. What wrong am I doing?

Note:

  1. $PROJECT_PATH: $GOPATH/project/
  2. All the commands are being run in $PROJECT_PATH
Mangat Rai Modi
  • 5,397
  • 8
  • 45
  • 75

1 Answers1

0

I am missing the src directory. $GOPATH directory has a certain structure and your projects folder should be located in the src directory.

Can't confirm that this is causing your issue, but it is worth a try: Move your folder labs-audience to /Users/XYZ/go_code/src/labs-audience.

For more information on setting your project up check the Code Organization part on How to Write Go Code.

Note: to keep package paths distinct it is suggested to use a public path for your project. Normally a github (or other vcs path) is used. For example: /Users/XYZ/go_code/src/github.com/YourAccount/labs-audience

TehSphinX
  • 6,536
  • 1
  • 24
  • 34