Appengine Go1.11 Beta部署失败

时间:2018-12-24 11:05:06

标签: google-app-engine go

我正在尝试Go,并从go1.11 beta开始。 第一个Hello world示例运行良好,我可以通过浏览器查看它。

在我的第二次尝试中,我创建了多个.go文件(main.go,datastore.go)。 我可以在本地运行它,并且工作正常。

但是,当我尝试进行部署时,出现以下错误(第一个示例中的部署工作得很好):

gcloud app deploy
...
File upload done.
Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build 67d67177-13cd-4e80-980a-ea36a0760678 status: FAILURE.
Build error details: go build: cannot use -o with multiple packages

在服务器上,构建日志显示:

Step #1 - "builder": building app with command '[go build -o /tmp/staging735225713/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=d0f271c7f5b8 HOME=/builder/home BUILDER_OUTPUT=/builder/outputs DEBIAN_FRONTEND=noninteractive GOROOT=/usr/local/go/ GOPATH=/go GOPATH=/tmp/staging735225713/srv/gopath]': err=exit status 1, out=go build: cannot use -o with multiple packages
Finished Step #1 - "builder"
ERROR
ERROR: build step 1 "gcr.io/gae-runtimes/go111_app_builder:go111_20181212_RC00" failed: exit status 1

我在做什么错了?

更新: 尝试了各种操作,包括建议的子文件夹或“供应商”文件夹,但无济于事。

Updating service [default]...failed.                                                                                                                                                                       
ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build 79c39e82-3185-4ae1-a7ff-6afa1be448e7 status: FAILURE.
Build error details: srv/proto/myfile.pb.go:8:2: cannot find package "github.com/golang/protobuf/proto" in any of:
    /usr/local/go/src/github.com/golang/protobuf/proto (from $GOROOT)
    /tmp/staging770905501/srv/gopath/src/github.com/golang/protobuf/proto (from $GOPATH)

0 个答案:

没有答案