Notice: We have changed the project structure and it isn't compitable with before. You have to change the old structure to new manually.
GOP is a project manangement tool for golang application projects which you can place it anywhere(not in the GOPATH). Also this means it's not go-getable. GOP copy all denpendencies to src/vendor directory and all application's source is also in this directory.
So a common process is below:
git clone xxx@mydata.com:bac/aaa.git
cd aaa
gop ensure
gop build
gop test
- GOPATH compitable
- Multiple build targets support
- Put your projects out of global GOPATH
Please ensure you have installed the go command, GOP will invoke it on building or testing
go get github.com/lunny/gop
This is an example project's directory.
<project root>
├── gop.yml
├── bin
├── doc
└── src
├── main
│ └── main.go
├── models
│ └── models.go
├── routes
│ └── routes.go
└── vendor
└── github.com
├── go-xorm
│ ├── builder
│ ├── core
│ └── xorm
└── lunny
├── log
└── tango
The project yml configuration file. This is an example. Of course, if you didn't define any target, the default target is src/main and the target name is the project name.
targets:
- name: myproject1
dir: main
assets:
- templates
- public
- config.ini
- key.pem
- cert.pem
- name: myproject2
dir: web
assets:
- templates
- public
- config.iniCreate the default directory structs.
gop init
Auto copy dependencies from $GOPATH to local project directory. -g will let you automatically call go get <package> when the package is missing on GOPATH. -u will always go get <package> on all the dependencies and copy them to vendor.
gop ensure [-g|-u] [target_name]
List all dependencies of this project and show the status.
gop status [target_name]
Add a package to this project. -u will override the package dir on vendor.
gop add [-u] <package>
Remove a package from this project.
gop rm <package>
Run go build on the src directory.
gop build [target_name]
Run go run on the src directory.
gop run [target_name]
Run go test on the src directory.
gop test [target_name]
Run go release on the src directory.
gop release [target_name]