From profiling to debugging and everything in between

Image for post
Image for post
Photo by Zan on Unsplash

Once you understand the basics, Golang can make you more productive than ever before. But what do you do when things go wrong?

You may not know this, but Go natively includes pprof for recording and visualizing run-time profiling data. Third-party tools like delve add support for line-by-line debugging. Leak and race detectors can defend against non-deterministic behavior.

If you haven’t seen or used these tools before, they will quickly become powerful additions to your arsenal of Golang tools.

Why Don’t I Just Print Everything?

I’ve met a lot of developers who rarely open the debugger when they run into an issue with their code. I…


Is the technology ready for prime time?

Image for post
Image for post
Open for preview — Windows Server container on an Azure Kubernetes Service (AKS) cluster. How does it match up to longstanding Linux-based container alternative?

While still in preview, Azure Kubernetes Service (AKS) recently announced¹ support for Windows Server containers.

You can deploy ASP.NET applications, run PowerShell or Linux subsystem scripts, and enable autoscaling to meet customer demand. I’ve been using the service for about a month now, these are my key takeaways.

Windows Containers Are Slower and Clunky

Container-based development has a number of benefits like consistent environments, isolation, and a run-anywhere mentality².

When using Linux-based containers on Kubernetes, it usually comes with the advantage of being lightweight enough to scale and quickly meet traffic needs. Even the About Windows Containers page speaks to these benefits:

“Containers provide a lightweight…


Will working from home make you a happier, more engaged employee? Maybe.

Image for post
Image for post
Working from home can be a double-edged sword, but I prefer it to the routine commute and sometimes distracting office life

When I tell people I’m fully remote they have one of two reactions: they imagine some nightmarish trapped-at-home scenario where human interaction is nonexistent, or they dream of a life unchained from “the morning routine”. After about six months as a fully-remote employee, the result is somewhere in the middle.

How did I get here?

Similar to most newly graduated folks, I had no idea what I wanted to do next. I thrashed between pathways forward, from graduate programs to interviews with Google and the like. I almost ended up in the United Kingdom at business school. …


What you need to know when deploying Kubernetes yourself

Picture of the Kubernetes logo in a data center
Picture of the Kubernetes logo in a data center
Running Kubernetes on-premise give developers a cloud-native experience or set your organization up to be cloud-agnostic.

Whether you have your own on-premise data center, have decided to forego the various managed cloud solutions, or are developing software for a company that has — there’s a few things you should know when getting started with on-premise K8s.

If you’re already familiar with Kubernetes you know that the control plane consists of the kube-apiserver, kube-scheduler, kube-controller-manager and an etcd datastore. For managed cloud solutions like Google’s Kubernetes Engine (GKE) or Azure’s Kubernetes Service (AKS) it also includes the cloud-controller-manager. …


A few common mistakes and how to diagnose and fix them

Image for post
Image for post
Avoid pitfalls while writing simple, reliable Go code

There’s a few reasons I love Golang:

  • It’s a super small language (it has only 25 reserved keywords)
  • Cross-compilation is a breeze
  • Creating a reliable HTTP(s) server is natively supported

At its core, it’s a boring language, which is probably why awesome projects like Docker and Kubernetes are written in it and companies with high performance and resiliency requirements, like Cloudflare, are using it.

Despite its ease of use, Go really requires attention to detail. If you don’t use the language as it’s intended it can break. It can be hard to diagnose and challenging to fix the mistake.

Here…


Image for post
Image for post
The Go tool-chain can be useful even outside of Go development

TL;DR

The command go get will organize your code into an easy to follow directory structure that you can use across all your work-spaces. Give it a try even if you’re not a gopher.

Example: go get github.com/golang/go will clone the repository and put it at $GOPATH/go/github.com/golang/go where GOPATH usually defaults to your home directory.

Background

When I started using Golang 3 years ago, I came from a world of Python, PHP, and NodeJS where every time I created a new repository I would have to think about where it was going to go. This would usually result in directory structures like:

Tyler Finethy

Software Engineer at RStudio, Inc with a passion for small companies with big challenges. Currently interested in Golang, Kubernetes, and green tech. @tylfin 🚀

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store