尝试使用gcloud app deploy
使用Cloud SQL部署我的GO应用程序,但每次发现包找不到错误时,构建都会失败。不知道从哪里挑选GOPATH
。是否可以更改Google云引擎中的GOPATH
。
Step #0: main.go:9:2: cannot find package "github.com/gin-gonic/gin"
in any of: Step #0: /usr/local/go/src/github.com/gin-gonic/gin (from
$GOROOT) Step #0: /workspace/_gopath/src/github.com/gin-gonic/gin
(from $GOPATH) Step #0: main.go:10:2: cannot find package
"github.com/go-sql-driver/mysql" in any of: Step #0:
/usr/local/go/src/github.com/go-sql-driver/mysql (from $GOROOT) Step
#0: /workspace/_gopath/src/github.com/go-sql-driver/mysql (from $GOPATH) Step #0: main.go:8:2: cannot find package
"google.golang.org/appengine" in any of: Step #0:
/usr/local/go/src/google.golang.org/appengine (from $GOROOT) Step #0:
/workspace/_gopath/src/google.golang.org/appengine (from $GOPATH)
我有import语句包含上面的库。我的本地GOPATH
设置为/Users/amar.jain/go/
,并且正在尝试使用/workplace/_gopath/
我也在使用GO App Engine SDK。