- Create a folder named
katas. - Add a folder for the kata you want to create:
mkdir -p katas/hello_world
- Add the skeleton — this is the entrypoint for each day:
// hello.go func helloWorld() { } func main() { helloWorld() }
To begin a new day, run katac with the kata or katas you want to do
(arguments may also be paths):
# katac <kata_name>...
katac hello_worldThis creates a days folder containing day1/ with your kata.
You can run your kata if it has a Makefile (and make is on PATH),
or a run.sh (run.bat on Windows):
# Makefile
run:
go run hello.goAfter you finish writing the kata, e.g.:
import "fmt"
func helloWorld() {
fmt.Println("hello world")
}
func main() {
helloWorld()
}run it with:
# katac run [kata_name]...
katac runCreate a katac.toml file:
[katas]
katas_dir = "go-katas"
days_dir = "go-days"Pick N random katas from your katas directory:
# copies 4 randomly selected katas from your katas directory into days/
katac random 4To control which katas random picks from, add this to katac.toml:
[katas]
random = ["Map", "LRU", "Trie", "Stack"]Interactively select and copy example katas (uses the templates baked into the binary):
katac initUpdate to the latest release:
katac upgrade