If you're looking to contribute to this project, there's a few things you should know.
First, make sure you go through the README.
Second, it's written in Go. If you are new to Go, we recommend the following resources:
- Go 1.10+
- Make
- ...
You should already have installed Go and setup your workspace.
This includes setting a valid $GOPATH
.
$ go get -u github.com/CircleCI-Public/circleci-cli
$ cd $GOPATH/src/github.com/CircleCI-Public/circleci-cli
$ make
$ make test
If you ran go install
at some point, you will have a development version of circleci-cli
lingering around. You should clean this up with make clean
.
$ which circleci-cli
/Users/erichu/go/bin/circleci-cli
$ make clean
$ which circleci-cli
$
We use dep
for vendoring our depencencies:
https://github.com/golang/dep
If you want to update or modify any dependencies you will need to install it.
You can do so on MacOS:
$ brew install dep
$ brew upgrade dep
Or on Linux, etc:
$ curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
To make sure dependencies are installed:
$ dep ensure
We use gometalinter
for linting.
You can install it via $ make dev
or manually with:
$ go get -u github.com/alecthomas/gometalinter
$ gometalinter --install
Then you can run it with $ make lint
.
There is also a coverage
job as part of the build which will lint any code you commit.
Go has great tooling such as gofmt
and goimports
.
In particular, please be sure to gofmt
your code before committing.
You can install goimport
via:
$ go get golang.org/x/tools/cmd/goimports
The golang blog post "go fmt your code" has a lot more info gofmt
. To get it setup with vim or emacs.
For example, I've the following in my .emacs.d/init.el
:
(setq gofmt-command "goimports")
(require 'go-mode)
(add-hook 'before-save-hook 'gofmt-before-save)
(require 'go-rename)
You can view the documentation for this project in your browser using godoc
.
After installing it via make dev
.
- Run
make doc
. - Access http://localhost:6060/pkg/github.com/CircleCI-Public/circleci-cli/