私は現在、Goにアプリケーションを作成しており、複数のサービスを展開しようとしています。私は次のコマンドを実行しています:gcloud app deploy dispatch.yaml app/app.yaml mod1/mod1.yaml
。なぜcant go-app-builderがローカルインポートを見つけるのですか?
app.yamlをファイルには、デフォルトのサービスに対応し、成功したが、サービスMOD1戻り、このエラーに配備されています
ERROR: (gcloud.app.deploy) Error Response: [9] Deployment contains files that cannot be compiled: Compile failed: 2016/07/22 18:17:14 go-app-builder: build timing: 1×compile (53ms total), 0×link (0 total) 2016/07/22 18:17:14 go-app-builder: failed running compile: exit status 1
mod1.go:4: can't find import: "myapp/mod1/web_console"
My-Macbook: myapp$ gcloud app deploy dispatch.yaml app/app.yaml mod1/mod1.yaml
マイファイル構造は次のとおりです。
- /MY_PROJECT を
- /src
- /myappの
- /アプリ
- app.go
- app.yamlを
- /MOD1
- mod1.go
- mod1.yaml
- /web_console
- web_console.go
- /アプリ
- /myappの
- /src
mod1.go:
package mod1
import (
"myapp/mod1/web_console"
)
func init() {
// Initializing Web Console establishes connection
// to the database and also creates routes
var wc *web_console.WebConsole
wc = web_console.NewWebConsole(true)
wc.Configure()
}
mod1.yaml:
module: mod1
runtime: go
api_version: go1
handlers:
- url: /.*
script: _go_app
app.yamlを:助けるために時間を割いて
module: default
runtime: go
api_version: go1
handlers:
- url: /.*
script: _go_app
ありがとう!
ありがとうございました!残念ながら、インポートステートメントを変更した後でも、私はまだエラーが発生します:インポートを見つけることができません: "web_console"。 – MFreundlich