Jump to Content

Andrew M McCall

golang

Unit Testing Json Encode

Here are my notes on testing a JSON writer for Golang that lets you wrap the response in an envelope

Golang Create a Random String

Go’s rand package can help us easily generate a random string for when we need to ensure uniqueness with naming in our applicaton. We walkthrough the process of generating a random string using golang.

Go Channels Tutorial - Understanding Goroutines and Channels

Go has powerful concurrency tools fully baked into the programming Language. This post aims to explain go routines and channels so you can get started using them in your own projects.

Golang Image Resize and Golang Image Crop: Image Manipulation With Go Programming Language

An introduction to some of the very basic features of iamge cropping with Go.

Golang Read Environment Variables From File: How To Do It [Code Snippets]

What Are Environmental Variables In Go A Cautionary Tale: My AWS Account Was Hacked And I Have A $50,000 Bill If you have ever used an API key or database connection string, you have most likely had a need to secure some sensitive data. Environment variables are a way to achieve this. We may need to do this because certain API’s can only be called so many times and the key is a way of authorizing our requests and keeping track of them.

How To Create A Template Cache For Your Golang Web Application

A beginner’s guide to create a reusable template cache for your Go web application: eveything you need to get started. For example the net/http and html/template package are part of the standard library and allow us to create full-featured web applications with just the standard library. Template Cache In Go Web Applications: A Beginner’s Guide Getting started creating a web application with Go isn’t difficult. One area that was difficult for me was the idea of creating a template cache to serve Go template files.

Bootstrap A New Hugo Theme From Scratch [video]

A part of using Hugo is the freedom of making your own theme. In this tutorial, I will explain how to bootstrap a new Hugo theme so you can customize it exactly how you want to. I will go over verifying installation, creating a theme, telling Hugo how to use your new theme, and we walk through the very basics of setting up a theme so that the home page displays.

Install Hugo With Chocolatey Package Manager On Windows 10 [video]

Installing Hugo on Windows is easy with chocolately package manager. For those who are not familiar, Hugo is a static website generator that can help you manage blazing fast static websites with minimal effort. If you are on Windows, installing Hugo is easy using Chocolately Package Manager. Here are the steps we take. Directions To Install Hugo on Windows 10 With Chocolately Package Manager Navigate to chocolately package manager Click the “install” link which is located at the top right hand corner next to the light/dark toggle.