gcloud app deploy で cannot import internal package エラー


ERROR: (gcloud.app.deploy) Error Response: [9] Deployment contains files that cannot be compiled: Compile failed:
2017/12/05 23:43:37 go-app-builder: Failed parsing input: package "github.com/Michael-Inc/carapp-server/vendor/google.golang.org/appengine/file" cannot import internal package "google.golang.org/appengine/internal"

src/cmd/go-app-builder/parser.go で以下のように import を処理している。

for path := range imports {
    pkg, ok := app.PackageIndex[path]
    if !ok {
        // A file declared an import we don't know.
        // It could be a package from the standard library.
        if findInternal(path) {
            return nil, fmt.Errorf("package %q cannot import internal package %q", p.ImportPath, path)
    p.Dependencies = append(p.Dependencies, pkg)

findInternal は以下のとおり。

func findInternal(path string) bool {
    return strings.HasSuffix(path, "/internal") ||
        strings.HasPrefix(path, "internal/") ||
        strings.Contains(path, "/internal/") ||
        path == "internal"

internal という名前だとエラーにされてしまう。

まだ解決されていない模様 https://issuetracker.google.com/issues/38449183

Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account log in.