Learning Go by building a Static Site Generator
Channel: Jantcu
Date: 07/10/2020

From the Balitmore Golang meetup on 10/6/2020: https://www.meetup.com/BaltimoreGolang/events/twgcdqybcnbjb/

I took a different approach to learning Go than I had used to learn other languages in the past. Instead of endlessly watching tutorials (I did watch some), I fully immersed myself in a project (https://github.com/plentico/plenti) right from the start to learn the basics. Go is a lot different from other languages I've tried, but Its simplicity made me feel productive early on and excited to build new things. I quickly learned how to unmarshal JSON into a struct, walk a file tree, export variables for use in other packages, and use the defer keyword to benchmark different parts of the build. There were also some aspects that I wasn't aware of that caught me off guard when I first got started such as avoiding circular dependencies, using generators to embed static files in a binary, and cross compiling with CGO. On my journey I've learned how to build a CLI tool with Cobra, automate deployments with Goreleaser and GitHub Actions, and compile CGO to run JavaScript in a v8. I'm hoping that sharing my experience will encourage other new folks to get started on their next project with Go and clear up some general concepts that will ultimately save them a lot of time.