Photo by Alessio Zaccaria on Unsplash

You’ve seen the articles. “Don’t use If-Else”, and “Here’s a design pattern to stop using If-Else”, or Stack Overflow questions asking why If-Else is bad. I even read one article recently that said, and I quote, “But, let’s put an end to that right now, by replacing If-Else with the state object.” There seems to be some idea among some software engineers that using the If-Else construct in your language of choice is a bad thing. I submit to you, dear reader, that it is not.

Please note that this is my opinion I am sharing with you, and that…


Photo by David Pisnoy on Unsplash

This is part 4 in a four part series where we will demonstrate building a web application using Go and Vue, and finally bundle it all together in a single binary for super-easy deployment/distribution. Part 1 can be found here, part 2 here, and part 3 here.

In part 1 we built the Go and Vue apps. In part 2 we changed the Go app to automatically start the Vue app by running Node when the version of the application is “development”. In part 3 we bundled it all up into a single compiled binary. …


Photo by Annie Spratt on Unsplash

This is part 3 in a four part series where we will demonstrate building a web application using Go and Vue, and finally bundle it all together in a single binary for super-easy deployment/distribution. Part 1 can be found here and part 2 here.

In part 1 we built the Go and Vue apps. In part 2 we changed the Go app to automatically start the Vue app by running Node when the version of the application is “development”. In this article we are going to do the following.

  1. Build a final version of the Vue app
  2. Bundle the final…


Photo by Sigmund on Unsplash

This is part 2 in a four part series where we will demonstrate building a web application using Go and Vue, and finally bundle it all together in a single binary for super-easy deployment/distribution. Part 1 can be found here.

In the first part of this series we built the Go and Vue apps. The Go application is a simple HTTP server that has a single endpoint which returns the version of this application. The Vue app is the stock Vue CLI hello world, but we added code to pull the version from the Go API and display it on…


Photo by Gift Habeshaw on Unsplash

Often I find myself tasked with building web applications or APIs with web management portals. On the backend my language of choice is Go, while on the frontend my framework of choice is Vue. One of the big benefits of Go is it compiles into a single binary. When building an API in Go, and a frontend in JavaScript though, these are two different stacks, and as such might mean deploying two different apps. And in some cases that may be desirable. …


Photo by Luis Villasmil on Unsplash

Disclaimer: The following statements are mine, and do not relate to my employer or any of their or my clients. This article is based on a real story, but the details have been changed to protect the original source.

As software engineers we often have a hundred things to consider aside from the code we are writing, be it testing, servers, or deployment. One area that can be easily overlooked is security. I came across the following gem one day when assisting in a security review of an application.

The application in question accepted user input, and at some point…


Photo by Bernd Klutsch on Unsplash

Go, commonly referred to as “Golang”, is a great language for writing RESTful service applications. Every good service application should have documentation describing its endpoints for future consumers, even if that consumer is you. Enter Swagger, one the best ways to document RESTful APIs. In this article I’ll talk about using a tool called swag to document and generate an endpoint for viewing your documentation.

Let’s start with a small, simple example application that exposes an endpoint that returns an array of values. …


Photo by Sai Kiran Anagani on Unsplash

I don’t know about you, but I seem to learn something new about Vim everyday. If not something new, at least a new way to use something I already knew. Macros are something I’ve known about for a little bit, but I sometimes forget to make use of their power.

Let me present an example. Let’s say I have a structure in Go that looks like the one below. Note: I’m only using Go as an example here. I’m sure what I’m about to show you can apply to any language.

In the above sample structure we have some…


Photo by Kevin Ku on Unsplash

Yup. Here’s another “here’s my Vim configuration” post. These are a dime a dozen these days, as it seems “hip” to post your Vim config. That being said, as a programmer I often find it useful to see other people’s configuration, as sometimes it gives me an idea, or I learn a new trick. So, with that spirit in mind, here is my configuration.

For my Vim configuration I use Plug to manage plugins, so if you use another plugin management system, your mileage will vary. Also, I have some keybindings specific to the programming languages I spend the most…


Photo by Claudio Hirschberger on Unsplash

It’s another work night plugging away at code. I find myself in yet another situation where I want to integrate with a 3rd party RESTful API, and I’ll need to make a LOT of API calls. I don’t want to flood their server, and I don’t want too many open TCP connections and get a nasty message about too many open files. It’s a fairly common problem. In fact, there are numerous articles on the internet which offer solutions for controlling the number of simultaneous goroutines executing work. Well… here’s another, fairly simple, naive approach.

Disclaimer! The code found here…

Adam Presley

Just a guy who loves his wife, kids, and writing software.

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