Why Cuvva loves Google’s programming language ‘Go’

Our backend engineer Andy explains why Cuvva has fallen in love with Google’s programming language Go.
By Team member, 22/11/2021
2 minutes read

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.

📐Cross-platform and cross-architecture support

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.

🔥 Blazing fast compile times

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.”

🔧 Linters and tooling

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 as a first-class citizen

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.

🐻 GopherCon UK 2021

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!

👋 Join us

If you love Go and want to help us make radically better insurance, head over to our careers page. We’re hiring! 🚀

Team member

Team member