解:
1)删除“上下文”导入
2)导入“ google.golang.org/appengine”;看到
[https://github.com/golang/appengine/blob/master/README.md][1]
有关更多详细信息,请参阅:本地appengine软件包安装
3)此功能
http.HandleFunc("/", bqPage)来电
bqPage(w http.ResponseWriter, req *http.Request)
作为处理程序功能。将第二个req参数传递给构建/调用bigquery客户端的代码:
ctx := appengine.NewContext(req) // Get the projectID value from the Google Cloud Console: projectID := "--------------" // Create a client. client, err := bigquery.NewClient(ctx, projectID)
一旦有了客户对象,就可以开展业务。
4)在DOS窗口中指向托管main.go文件的目录,运行
gcloud app deploy
然后使用
gcloud app browse



