Google App Engine说我的导入语句不正确?

huangapple go评论83阅读模式
英文:

Google appengine saying my import is incorrect?

问题

第一次使用Google AppEngine,我正在尝试启动我的当前文件:

├── app.yaml
├── controllers
│   ├── admin
│   │   └── admin.go
│   ├── auth
│   │   ├── login.go
│   │   ├── register.go
│   │   └── validate.go
│   ├── common
│   │   ├── common.go
│   │   └── dbstructs.go
│   ├── forum
│   │   └── forum.go
│   ├── home
│   │   └── home.go
│   └── user
│       └── user.go

然后我运行 goapp serve,结果出现:

2015/12/13 22:16:29 go-app-builder: Failed parsing input: parser: bad import "../common" in controllers/home/home.go

我不确定为什么会出现错误的导入,或者AppEngine是否创建了自己的环境。任何帮助都将是很好的。

英文:

First time using google AppEngine and I am trying to launch this is my current files

├── app.yaml
├── controllers
│   ├── admin
│   │   └── admin.go
│   ├── auth
│   │   ├── login.go
│   │   ├── register.go
│   │   └── validate.go
│   ├── common
│   │   ├── common.go
│   │   └── dbstructs.go
│   ├── forum
│   │   └── forum.go
│   ├── home
│   │   └── home.go
│   └── user
│       └── user.go

then I do goapp serve and I get :

2015/12/13 22:16:29 go-app-builder: Failed parsing input: parser: bad import "../common" in controllers/home/home.go

I'm not sure why it's a bad import or of appengine makes its own environment or something any help would be great.

答案1

得分: 2

在导入语句中使用绝对路径:

import (
    "controllers/common"
)
英文:

Use absolute an absolute path in the import statement:

import (
    "controllers/common"
) 

huangapple
  • 本文由 发表于 2015年12月14日 13:17:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/34260219.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定