Go (http://golang.org/) Editors, Version Control, Test Driven Development, Documentation, and Continuous Integration.
So if we’ve decided that Testing is cool:
- http://www.markbernstein.org/Apr14/Driven.html
- http://www.rbcs-us.com/documents/Why-Most-Unit-Testing-is-Waste.pdf
Then the resources to look at for ‘Go’ are at:
- http://blog.stretchr.com/2014/03/05/test-driven-development-specifically-in-golang/
- https://jmcvetta.github.io/blog/2013/08/30/continuous-integration-for-go-code/
- http://golang.org/pkg/testing/
- http://go-lang.cat-v.org/text-editors/
- http://geekmonkey.org/articles/20-comparison-of-ides-for-google-go
- https://app.wercker.com/#explore
- http://www.golanglab.com/
So I’m tempted to use LiteIDE (https://code.google.com/p/golangide/) and I’ve downloaded it, but maybe this is more of a production tool as opposed to a learning tool, and so I’ve chosen TextMate (I just don’t like Sublime – SublimeText 3 – Go Language Plugins – costs $70 and seems to be a text editor of the moment…) (TextEdit – Mac use it already – has Go Bundles http://go-lang.cat-v.org/text-editors/textmate/) because I’ve got it and it has bundles for ‘Go’. I was also considering Conception (https://github.com/shurcooL/Conception) but I think this is something for later as it’s Go I’m interested in not IDEs. So basic editors and manual processes to start with.
Now GitHub is the standard for most open source projects but they didn’t used to allow private projects for free. They do allow up to five now (for academics), but I’d already moved to BitBucket who’ll give unlimited private projects – and that’s useful as they version LaTeX so I can work on many documents in private. So BitBucket it is. And my CI choice is made by this decision as drone.io seems to integrate well with BitBucket. And if we add goveralls to coveralls.io then we can link drone to coveralls and get code test coverage.
So we have:
Editor: TextMate with Go Bundle – can try running at http://play.golang.org/;
Version Control: BitBucket using a Git Repo;
Test Driven Development: Tests using the standard go testing package – run manually until check-in (Go Test Coverage https://github.com/axw/gocov); with
Test Coverage: use coveralls.io (https://coveralls.io/);
Documentation: godoc as you’d expect (http://blog.golang.org/godoc-documenting-go-code – http://golang.org/src/pkg/encoding/gob/doc.go); and
Continuous Integration: drone.io (https://drone.io/).
My process.
I’m not part of a team and so the check-ins to version control will probably be at the end of a day – at going home time. So I’ll need to run tests and code through the day then a final check-in with integration (so I suppose discontinuous) and coverage analysis. Which should point to development tasks for the following day.
It’s Lunchtime and I’ve made a set (of what I think are logical decisions).
Now in practice….
- Private Repo created https://bitbucket.org/sharpic/searchgear (hopefully public one-day) using SourceTree to Manage the Updates.
- Go Installed http://golang.org/dl/ – Bundle Installed https://github.com/AlanQuatermain/go-tmbundle
- Need to set https://code.google.com/p/go-wiki/wiki/GOPATH – http://golang.org/doc/code.html – path set export GOPATH=/Volumes/WorkingBox/2014/Development/searchgear and export PATH=$PATH:$GOPATH/bin so this isn’t a general path but one to searchgear in my encrypted folder – looking at it this way I can see that I’ll need to make some changes to my directory structures. Indeed now done as I need to install other stuff so $GOPATH is now ‘/Volumes/WorkingBox/Development/go’ and then the target is $GOPATH+src/bitbucket.org/sharpic/searchgear
- https://github.com/bmizerany/assert – try as described on ‘assert’ not via jmcvetta ‘get’ — Annotation – OK so this is the same you need to go get the package using the full web path gives uniqueness.
- Using point as the build example but with file changes to searchgear.go – failed to build with errors on most lines. Changed to the jmcvetta example – still failed to build. CRITICAL – must save go files on TextMate with LF(recommended) / Unicode – UTF-8 / and critically the ‘Add byte order mark’ selected.
- go test -v – executes OK
- Changed the drone config to include ‘go get github.com/bmizerany/assert’
- Installing ‘go get -v github.com/axw/gocov/gocov’ errors – needed Mercurial and so installed from http://mercurial.berkwood.com/
- $ gocov test | gocov report – executes OK