Category: Go

Go sql examples

Go sql examples using sqlx Assume you have two models a type Business and a type Widget in a one to many relationship. I want to demonstrate two ways that you can load the...

Golang YAML to map

How to convert a YAML file to a map[string]string in Go Use go-yamlconfigfile project to convert simple yaml config files to maps in Go. When you want to store secrets for your project, you...

Go Closures as Struct Members

How to store closures at runtime inside struct members in the Go programming language.   I will also show you how you can change the closure stored as a member inside of your struct...

Consul Service Discovery and leader election

Elect a leader with Consul for your service So I started testing out a service discovery platform called Consul by the company Hashicorp. The system uses the raft consensus protocol, and you may run...

How to use SASS to generate CSS

Using SASS or SCSS to generate CSS with your favorite language I am not big on using grunt or gulp, but I do like the power of what SASS offers, so I am going...