doushan15559 2016-01-15 01:36
浏览 524

我无法使用google.golang.org/appengine模块将Go模块部署到App Engine

From the latest material I can read, and also based on documentation on certain APIs (for example, the Go Datastore API), I'm supposed to use google.golang.org/appengine etc. instead of the old appengine/... paths. However, when I try to deploy using gcloud preview app deploy, I get the following error:

Deployment contains files that cannot be compiled: Compile failed:

2016/01/14 14:32:43 go-app-builder: build timing: 2×6g (113ms total), 0×6l (0 total)
2016/01/14 14:32:43 go-app-builder: failed running 6g: exit status 1

server/alexa.go:10: can't find import: "golang.org/x/net/context"

The golang.org/x/net/context package supposedly replaces the old appengine/context one, but it doesn't appear to be available in the deployment server's GOROOT.

I tried including all the dependencies and their dependencies in my package repo but that only lead me to this obscure error (the directory it's complaining about actually exists):

Deployment contains files that cannot be compiled: Compile failed:

2016/01/14 14:27:04 go-app-builder: build timing: 18×6g (1.819s total), 0×6l (0 total)
2016/01/14 14:27:04 go-app-builder: failed running 6g: exit status 1

github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.pb.go:27: can't find import: "github.com/golang/protobuf/protoc-gen-go/testdata/multi"

Have I misunderstood the documentation and am only supposed to use the old packages?

  • 写回答

3条回答 默认 最新

  • duangu1868 2016-01-28 03:18
    关注

    You need to do a go get golang.org/x/net/context to save that package in your go src directory. Though, when working with App Engine it is not necessary. Those libraries can be imported and used, but they mostly focused on applications run outside of App Engine, i.e. Container Engine or Compute Engine. They essentially hook into the RESTful APIs Google cooked up for those services. If you decide to work directly with Google Cloud Storage you would need those libraries since App Engine expects you to use Blobstore instead. Hope this helps.

    评论

报告相同问题?

悬赏问题

  • ¥15 算法题:数的划分,用记忆化DFS做WA求调
  • ¥15 chatglm-6b应用到django项目中,模型加载失败
  • ¥15 武汉岩海低应变分析软件,导数据库里不显示波形图
  • ¥15 CreateBitmapFromWicBitmap内存释放问题。
  • ¥30 win c++ socket
  • ¥30 CanMv K210开发板实现功能
  • ¥15 C# datagridview 栏位进度
  • ¥15 vue3页面el-table页面数据过多
  • ¥100 vue3中融入gRPC-web
  • ¥15 kali环境运行volatility分析android内存文件,缺profile