尝试使用 Cloud SQL 部署我的 GO 应用程序,gcloud app deploy
但每次构建都失败,并出现未找到包的错误。不知道它是从哪里挑选的GOPATH
。是否可以更改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)
我有导入语句来包含上述库。我的本地GOPATH
设置为/Users/amar.jain/go/
并且正在尝试使用/workplace/_gopath/
我也在使用 GO App Engine SDK。