dsfdsf23423 2015-12-17 23:30
浏览 103

如何创建一个新的GoClipse项目,使其遵循正常的Go项目结构?

My Environment:

  • OS X 10.10.5
  • Eclipse Mars.1 (4.5.1)
  • GoClipse 0.13.0
  • go version go1.5.2 darwin/amd64

My GoClipse Settings:

  • Eclipse workspace: /Users/ray/go_workspace
  • Go Installation
    • GOROOT: /usr/local/go
    • gofmt: /usr/local/go/bin/gofmt
    • godoc: /usr/local/go/bin/godoc
    • GOOS:
    • GOARCH:
    • GOPATH: [x] Same as GOPATH env variable (which is /Users/ray/go)
  • Tools
    • Go oracle path: /Users/ray/go/bin/oracle
    • [x] Start gocode server automatically
    • [x] Enable gocode log console
    • gocode path: /Users/ray/go/bin/gocode

When I create a new Go project using default settings, the project folder is put under the eclipse workspace: /Users/ray/go_workspace/project with the bin, pkg, and src folders as subfolders.

What I want to do is create a new Go project and have it use:

  • /Users/ray/go/src/github/user/project for the source directory
  • /Users/ray/go/pkg/darwin_amd64/github/user/project for the package directory
  • /Users/ray/go/bin for the binary directory
  • /Users/ray/go_workspace/user/project for any Eclipse/GoClipse settings

How do I configure Eclipse/GoClipse/Project settings to get this to work?

  • 写回答

1条回答 默认 最新

  • dongqiu3254 2016-01-11 15:03
    关注

    Unfortunately the above is not possible. The closest you can get is creating your Eclipse project in the location /Users/ray/go/src/github/user/project (note that beforehand you will need to set the Eclipse preferences GOPATH to /Users/ray/go). This way you will have:

    • /Users/ray/go/src/github/user/project for the source directory
    • /Users/ray/go/pkg/darwin_amd64/github/user/project for the package directory
    • /Users/ray/go/bin for the binary directory

    but Eclipse settings/files will be in /Users/ray/go/src/github/user/project. (ATM, the only Eclipse files are .project and .settings/. You can add these to Git ignore if you are concerned about them appearing in version control)

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度