Advertisement
AlexLuya

go test,can't find package

Oct 27th, 2011
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 1.43 KB | None | 0 0
  1. 1,My gopath like this
  2. >echo $GOPATH
  3. /home/my/gopath,/home/my/IdeaProjects/XServer/src
  4.  
  5. 2,and I have a project with directory structure like this:
  6. /home/my/IdeaProjects/XServer
  7. └── src
  8.     ├── base
  9.     │   ├── http
  10.     │   ├── impl
  11.     │   └── logger
  12.     ├── comment
  13.     │   ├── create(a test file under this directory)
  14.     │   ├── delete
  15.     │   ├── retrieve
  16.     │   └── update
  17.     ├── db
  18.     ├── helper
  19.     ├── util
  20.     └── valid
  21.  
  22. 3,and a test file dao_test.go is under /home/my/IdeaProjects/XServer/src/comment/create
  23.  
  24. 4,and when I run: go test in directory /home/my/IdeaProjects/XServer/src/comment/create,got these errors:
  25.  
  26. CreateAction.go:13:2: cannot find package "base" in any of:
  27.     /home/my/go/src/pkg/base (from $GOROOT)
  28.     /home/my/go/gopath,/home/my/IdeaProjects/XServer/src (from $GOPATH)
  29. CreateDao.go:11:2: cannot find package "base/impl" in any of:
  30.     /home/my/go/src/pkg/base/impl (from $GOROOT)
  31.     /home/my/go/gopath,/home/my/IdeaProjects/XServer/src (from $GOPATH)
  32. CreateAction.go:11:2: cannot find package "comment" in any of:
  33.     /home/my/go/src/pkg/comment (from $GOROOT)
  34.     /home/my/go/gopath,/home/my/IdeaProjects/XServer/src (from $GOPATH)
  35. CreateDao.go:13:2: cannot find package "db" in any of:
  36.     /home/my/go/src/pkg/db (from $GOROOT)
  37.     /home/my/go/gopath,/home/my/IdeaProjects/XServer/src (from $GOPATH)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement