Reputation: 21
i have an problem with appengine and go112.
i can´t deploy without an error to the cloud:
2019/09/04 14:36:10 Copying /workspace/_gopath/src/mysql to /tmp/staging/srv/gopath/src/mysql
2019/09/04 14:36:10 Your app is not on your GOPATH, this build may fail.
2019/09/04 14:36:10 Building from Go source in /tmp/staging/srv, with main package at ./...
2019/09/04 14:36:10 Building /tmp/staging/srv, saving to /tmp/staging/usr/local/bin/start
2019/09/04 14:36:11 Wrote build output to /builder/outputs/output
2019/09/04 14:36:11 Failed to build app: Your app is not on your GOPATH, please move it there and try again.
building app with command '[go build -o /tmp/staging/usr/local/bin/start ./...]', env '[PATH=/go/bin:/usr/local/go/bin:/builder/google-cloud-sdk/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOSTNAME=89fd1b631b04 HOME=/builder/home BUILDER_OUTPUT=/builder/outputs DEBIAN_FRONTEND=noninteractive GOROOT=/usr/local/go/ GOPATH=/go GOPATH=/tmp/staging/srv/gopath]': err=exit status 1, out=go build: cannot use -o with multiple packages.
PS C:\gopath\projects\gp-sql>
My project is under the gopath and i tried serveral modifications of it.
output of "go env"
set GOPATH=C:\gopath
set GOROOT=C:\golang
Anybody an idea what i´m missing?
Upvotes: 2
Views: 1395
Reputation: 11286
Your project folder should be in "\src", not "\projects".
For standard Go setups, whatever your basic GOPATH environment variable points to, inside that folder should be a structure like:
bin/
# command executables
src/
github.com/golang/example/
.git/ # Git repository metadata
hello/
hello.go # command source
myproject1/
main.go # command source
main_test.go # test source
app.yaml # google cloud configuration
myproject2/
beepboop.go # command source
stringutil/
reverse.go # package source
reverse_test.go # test source
golang.org/x/image/
.git/ # Git repository metadata
bmp/
reader.go # package source
writer.go # package source
... (many more repositories and packages omitted) ...
Upvotes: 2
Reputation: 4961
This is a documented difference in the new version of go. Following this documentation should do the trick
If this doesn't work for you try creating a new GPATH folder, modify the Env Variable to make this folder you new gopath and put your application in the root of that folder.
Upvotes: 1