First, thank you! 🎉 Exercism would be impossible without people like you being willing to spend time and effort making things better.
You'll need Go version 1.10 or higher. Follow the directions on http://golang.org/doc/install
You will also need dep
, the Go dependency management tool. Follow the directions on https://golang.github.io/dep/docs/installation.html
If you've never contributed to a Go project before this is going to feel a little bit foreign.
The TL;DR is: don't clone your fork, and it matters where on your filesystem the project gets cloned to.
If you don't care how and why and just want something that works, follow these steps:
- fork this repo on the GitHub webpage
go get github.com/exercism/cli/exercism
cd $GOPATH/src/github.com/exercism/cli
(orcd %GOPATH%\src\github.com\exercism\cli
on Windows)git remote rename origin upstream
git remote add origin git@github.com:<your-github-username>/cli.git
git checkout -b development
git push -u origin development
(setup where you push to, check it works)go get -u github.com/golang/dep/cmd/dep
- depending on your setup, you may need to install
dep
by following the instructions in thedep
repo
- depending on your setup, you may need to install
dep ensure
git update-index --assume-unchanged Gopkg.lock
(prevent your dep changes being committed)
Then make changes as usual and submit a pull request. Please provide tests for the changes where possible.
If you care about the details, check out the blog post Contributing to Open Source Repositories in Go on the Splice blog.
To run the tests locally
go test ./...
To test your changes while doing everyday Exercism work you
can build using the following instructions. Any name may be used for the
binary (e.g. testercism
) - by using a name other than exercism
you
can have different profiles under ~/.config
and avoid possibly
damaging your real Exercism submissions, or test different tokens, etc.
On Unices:
cd $GOPATH/src/github.com/exercism/cli/exercism && go build -o testercism main.go
./testercism -h
On Windows:
cd /d %GOPATH%\src\github.com\exercism\cli
go build -o testercism.exe exercism\main.go
testercism.exe —h
In order to cross-compile for all platforms, run bin/build-all
. The binaries
will be built into the release
directory.