英文:
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"
)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论