At Cuvva, we’ve been using Go (the Google-designed programming language) since 2016 and it’s our primary language for our backend codebase. We want to explain why we love it! 😍
We’ve even made some of our Go libraries open-source. You can check them out on our GitHub.
Go makes cross-compilation ‘just work’. Go can build a binary of a different architecture, just by simply specifying the GOARCH environment variable, e.g: "GOARCH-arm64 go build…"
This has allowed us to be very flexible with what we use to develop locally, as well as our production environment. For local development, we use MacOS, both x86 and ARM. And our production environment uses Kubernetes running Linux with both x86 and ARM nodes.
On an M1 Macbook, doing a clean build of our entire Go codebase which comprises over 90 microservices, takes just 16 seconds.
But it gets even better. Go is very effective at caching, so making subsequent builds takes just 3 seconds.
This is all included out-of-the-box, and according to Go’s documentation: “The build cache correctly accounts for changes to Go source files, compilers, compiler options, and so on.”
Go comes with lots of tooling as standard. There’s in-built dependency management, formatting tools, documentation, testing framework, test coverage, language server and even fuzzing.
Go comes with some strong opinions on formatting and has gofmt to format your code for you. This is brilliant as there should be no need for formatting debates ever again. Issues such as code formatting are often the least important, but take up a disproportionately large amount of time.
At Cuvva, we use golangci-lint, running on all our pull requests. It includes lots of linters as standard and allows you to configure which ones you’d like to use. These help keep our codebase in tip-top condition.
Concurrency is when multiple tasks are performed at the same time. Go has rich support for concurrency, with goroutines and channels built-in and packages such as errgroup.
At Cuvva, we want to give an amazing user experience and part of that means ensuring our API has quick response times. With our microservice architecture, we often need to fetch data from multiple sources. Go’s concurrency allows us to do this with ease.
We were proud to be one of GopherCon UK’s 2021 sponsors. Our very ownTiago Mendes presented a talk on coordinating data changes in distributed systems, which will be online soon!
If you love Go and want to help us make radically better insurance, head over to our careers page. We’re hiring! 🚀
Follow us on...
Team member