Agent service discovery

—
in case anyone else reading through this is curious, as I was:

> deferred functions are executed ... in the reverse order they were deferred.

https://golang.org/ref/spec#Defer_statements