I created by the commands govendor init
and govendor fetch "github.com/gorilla/mux"
the vendor directory in the project.
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()
}