IDK man, I think I’m the shit, but maybe I’m an outlier.
I guess my point is that one or two people shouting down your language choice shouldn’t stop you from doing your project.
For example: I hate ruby, but I love gitlab and think they should keep up the work. I’m not going to not use gitlab because of the language it’s written in, I’m just less likely to contribute a bug fix.
When there’s no return value other than an error you’ll be handling right then and there, this error handling is better written as:
if err := glb.ExecuteTemplate(os.Stdout, nil); err != nil {
log.Fatalf("failed to execute glb template: %v", err)
}
Also, try not to execute any complex templates directly to result (stdout/socket/http body/…), if you can help it, use a small bytes.Buffer and only copy from it if things don’t error out. (Might help security a little bit in some cases, usually doesn’t matter in terms of performance).
Let me know if you need help with Go, (used it daily for almost 3 years as my primary language on a big project, seen all sorts of things done with it)
Feel free to follow godoc links into implementation, read and learn.
Use log.Somethingf freely and a lot, it’s useful for figuring out wtf is going on when things start looking odd; forget about debuggers that step through code, chances are you’re not among the 2% of people who can use them effectively.
Also,
Use a nice development environment, e.g. vscode or atom or vim with all the plugins, at very least gofmt and goimports that help you format sloppy code and help train you to write nice looking working code.
Don’t refactor too much, tooling for that sucks… instead; try things out on small scale (e.g. play.golang.org or in a separate package/directory with a package main file or in a file_test.go), factor new part in, test, debug; try next small thing on a small scale, factor it in, test debug; rinse, repeat
git commit -a often; in a cron if you have to descriptions be damned; once you think you have something coherent you can easily turn it into a squashed commit on a new branch
go build/test/install are quick, but add a small Makefile to help set the right environment for you and help you chain your usual write/run cycle
Don’t underestimate how much code you can write in an afternoon, keep writing.