1
votes

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

1 Answers

0
votes

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)