Photo by David Pupaza on Unsplash

Handling errors in Go

Go has a unique stance on errors by treating them as values. There are no such constructs as exceptions in the language, although you may treat errors in this manner. Dealing with errors can sometimes feel cumbersome and verbose. However, in Go 1.13 the introduction of Wrapping and Unwrapping errors was added to the language. This extends errors to embed errors within themselves, creating a nest of errors that you can interact with....

June 18, 2023 · David Dymko
photo by Kai Dahms on Unsplash

Profiling in Go

Have you ever wanted to dig deeper for explanations as to why your applications are bulking up on memory or the CPU spikes up? While monitoring tools tell that it is happening, you don’t know why. This is when profiling is fantastic. Profiling offers better insight into how your application interacts with CPU or memory. It allows for easier access for making optimizations to how your code behaves. Go comes with a native profiling tool called pprof....

August 6, 2022 · David Dymko

Json API errors with GO

I spend a lot of time writing microservices in Go. Therefore, I found myself needing a concrete way to hand errors back to the client that was predictable and repeatable. So I decided to follow the error response structure from https://jsonapi.org/format/#errors. This spec makes it very clear and concise to where the client can always expect a well formatted response that will never stray. A few notable takeaways with this spec are:...

November 25, 2018 · David Dymko
Photo by Ricardo Gomez Angel on Unsplash

Deploying Docker & Go to AWS Beanstalk

Recently, I had an opportunity to deploy a Go application into AWS Elastic Beanstalk, and I was surprised at how painless the deployment was. Without having to worry about infrastructure issues, I was able to get my Go app deployed. Below is a break down, from start to finish, on how to get a simple Go app out to Elastic Beanstalk using docker. Prerequisites Before we get started, there are a few things that need to be setup/installed:...

October 11, 2018 · David Dymko