如何使用 Golang 1.15(无服务器框架)部署 GCP 功能

时间:2021-05-05 08:51:45

标签: go google-cloud-functions serverless-framework

是否可以使用无服务器框架在 Go 1.15 中部署 GCP 功能?

看起来 1.15 可用 (https://cloud.google.com/appengine/docs/standard/go/runtime),但我找不到使用 Serverless 的方法。

无服务器.yml

...
provider:
  name: google
  runtime: go115
...

我有这个 Invalid runtime 错误:

{"ResourceType":"gcp-types/cloudfunctions-v1:projects.locations.functions","ResourceErrorCode":"400","ResourceErrorMessage":{"code":400,"message":"The request has errors","status":"INVALID_ARGUMENT","details":[{"@type":"type.googleapis.com/google.rpc.BadRequest","fieldViolations":[{"field":"runtime","description":"Invalid runtime."}]}],"statusMessage":"Bad Request","requestPath":"https://cloudfunctions.googleapis.com/v1/projects/**************/locations/us-central1/functions/*****","httpMethod":"PATCH"}}

1 个答案:

答案 0 :(得分:0)

Cloud Functions 的 regularbeta version 不支持 GO1.15 运行时。

改用 Go1.13,或使用 Cloud Run。

相关问题