Practice yourself, for heaven's sake, in little things; and thence proceed to greater. -- Epictetus
Go katas
Katas (形) are practiced in martial arts as a way to memorize and perfect the movements being executed. Let's try the same with code. The approach is pretty low-tech. It's a list of packages and commands that you should be rewriting from scratch or at least partially. There's a command to visualize your progress:
$ go run cmd/katas.go
Kata Last done Count
---- --------- -----
areader 11 days ago (Fri) 1
bytecounter 8 days ago (Mon) 1
clock2 8 days ago (Mon) 1
---- -----
3 3
Go katas should be useful for folks trying to learn to program in Go and/or for those who don't get to program every day but still want to keep their skills fresh (e.g. sysadmins, devops or security people).
It's important to practice regularly, to create a habit. Start by taking baby steps, e.g. 15 minutes a day. After some time it will require much less will power, it will become natural for you.
Initial setup
-
Install Go or run inside a container:
docker run --rm -it golang /bin/bash
. -
Fork and then clone the repo:
git clone [email protected]:<you>/gokatas.git
. -
Start practicing:
cd gokatas
go doc