duanchandun1860 2019-02-01 19:28
浏览 95
已采纳

在部署中,gcloud没有遇到供应商依赖性

I created by the commands govendor init and govendor fetch "github.com/gorilla/mux" the vendor directory in the project.

enter image description here

However, when performing deploy in gcloud gcloud app deploy the following error occurs, github.com/gorilla/mux is not found:

ERROR: (gcloud.app.deploy) Error Response: [9] Deployment contains files that cannot be compiled: Compile failed: /work_dir/main.go:5:5: can't find import: "github.com/gorilla/mux"

What is missing to make deploy work? My plan is free in gcloud

app.yaml

service: api
runtime: go
api_version: go1

handlers:
- url: /sample
  script: _go_app

main.go

package main

import (
    "encoding/json"
    "github.com/gorilla/mux"
    "net/http"
    "google.golang.org/appengine"
)

type Foo struct {
    Text string `json:"text"`
}

func GetInfo(w http.ResponseWriter, r *http.Request) {
    json.NewEncoder(w).Encode(Foo{"hello"})
}

func init(){
    r := mux.NewRouter()
    r.HandleFunc("/sample", GetInfo)
}

func main() {
    appengine.Main()
}
  • 写回答

1条回答

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 如何在微信支付V3PHP版请求中添加header?
      • ¥15 在数字信号处理中用MATLAB显示波形。
      • ¥15 keil MDK软件进行仿真调试的局限
      • ¥15 关于gateway产生临时文件夹的问题
      • ¥15 Java Broken Pipe以及OOM
      • ¥20 请问有没有RTL8211FS的参考原理图
      • ¥50 esp32的platfromio工程添加文件就会编译失败
      • ¥15 linux下运行VASP报错
      • ¥15 python里面查找赋值,如何可以在剩余未空值的行里面进行进一步的筛选呢?
      • ¥15 电路分析的综合实验有没有会的