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.8 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
go get github.com/exercism/cli/exercismcd $GOPATH/src/github.com/exercism/cli(orcd %GOPATH%/src/github.com/exercism/clion Windows)git remote set-url origin https://github.com/<your-github-username>/cligo get -u github.com/golang/dep/cmd/dep- depending on your setup, you may need to install
depby following the instructions in thedeprepo
- depending on your setup, you may need to install
dep ensure
Then make the change 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 on Linux or MacOS, use
go test $(go list ./... | grep -v vendor)
On Windows, the command is more painful (sorry!):
for /f "" %G in ('go list ./... ^| find /i /v "/vendor/"') do @go test %G
As of Go 1.9 this is simplified to go test ./....
You can build whatever is in your local, working copy of the CLI without overwriting your existing Exercism
CLI installation by using the go build command:
go build -o testercism exercism/main.go
This assumes that you are standing at the root of the exercism/cli repository checked out locally, and it will put a binary named testercism in your current working directory.
You can call it whatever you like, but exercism would conflict with the directory that is already there.
Then you call it with ./testercism.
You can always put this in your path if you want to run it from elsewhere on your system.
We highly recommend spinning up a local copy of Exercism to test against so that you can mess with the database (and so you don't accidentally break stuff for yourself in production).
[TODO: link to the nextercism repo installation instructions, and explain how to reconfigure the CLI]
In order to cross-compile for all platforms, run bin/build-all. The binaries
will be built into the release directory.