Sending MQTT messages on Raspberry Pi GPIO changes

I have had a node app that watches for changes to my Raspberry Pi’s GPIO pins and sends an MQTT message as part of my home automation setup. Recently I re-imaged my pi and much to my dismay really struggled to install the requisite libraries.

Raspberry Pi with Open Sprinkler Pi

Instead of banging my head against that wall any longer, I rewrote the app in go.