Posts

Ways to improve your team's code quality

I believe it is important for engineers to care about code quality. Some teams and companies make specific and targeted efforts to keep the quality of their codebases high. The existence of activities like "spring cleaning", "test Fridays", "Fixit week" and others assert the importance of code...

Pipelines and your Unix toolbox

Unix commands are great for manipulating data and files. They get even better when used in shell pipelines. The following are a few of my go-tos -- I'll list the commands with an example or two. While many of the commands can be used standalone, I'll provide examples that assume the input is piped...

Go scope

Scoping in Go is built around the notion of code blocks. You can find several good explanations of how variable scoping work in Go on Google. I'd like to highlight one slightly unintuitive consequence of Go's block scoping if you're used to a language like Python, keeping in mind, this example does...

Tracking a call stack in Go with context

The use of context in Go can help you pass metadata through your program with helpful, related information about a call. Let's build an example where we set a context key, "stack", which keeps a history of the function names called over the lifetime of the context. As we pass the context object...

Go channels

Go uses goroutines to execute multiple bits of code at the same time. Channels allow for the aggregation of the results of these concurrent calls after they have finished.