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

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

Google appengine saying my import is incorrect?

问题

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

  1. ├── app.yaml
  2. ├── controllers
  3. ├── admin
  4. └── admin.go
  5. ├── auth
  6. ├── login.go
  7. ├── register.go
  8. └── validate.go
  9. ├── common
  10. ├── common.go
  11. └── dbstructs.go
  12. ├── forum
  13. └── forum.go
  14. ├── home
  15. └── home.go
  16. └── user
  17. └── 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

  1. ├── app.yaml
  2. ├── controllers
  3. │   ├── admin
  4. │   │   └── admin.go
  5. │   ├── auth
  6. │   │   ├── login.go
  7. │   │   ├── register.go
  8. │   │   └── validate.go
  9. │   ├── common
  10. │   │   ├── common.go
  11. │   │   └── dbstructs.go
  12. │   ├── forum
  13. │   │   └── forum.go
  14. │   ├── home
  15. │   │   └── home.go
  16. │   └── user
  17. │   └── 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

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

  1. import (
  2. "controllers/common"
  3. )
英文:

Use absolute an absolute path in the import statement:

  1. import (
  2. "controllers/common"
  3. )

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:

确定