The right way to handle YAML in Go

Go's standard library includes the ability to serialize and deserialize structs as JSON. While Go doesn't have a native library for YAML, go-yaml can be used to accomplish the same thing. However, if you are trying to support both JSON and YAML, several issues arise when using go-yaml and Go's JSON library together. There's a counter-intuitive way to use both libraries that ends up being much safer and easier to maintain.

But first, let's step back and review JSON serialization in Go.

Read more...

Develop and run Kubernetes on your Mac

Kubernetes, Google's new Docker cluster manager, comes with a great script that lets you run an entire cluster locally using your source code tree named hack/local-up-cluster.sh. However, Kubernetes only runs on Linux, which means that if you're developing on your Mac you have to copy your source tree to a Linux machine to use the script (or switch to a Linux machine for development). Go in general, however, runs fine on Mac. Therefore, the ideal flow would be editing Kubernetes source files on your Mac, then automatically having them synced to a Linux VM where you can run hack/local-up-cluster.sh.

Read more...

Hello, world

Obligatory first post. Hopefully much more to come.

Read more...