Implementing Marshaler and Unmarshaler interfaces for Macaroon and Caveat.

slightly nicer:

mjson := macaroonJSON{
    Location: m.Location(),
    Identifier: hex.EncodeToString(m.id),
    Signature: hex.EncodeToString(m.sig),
    Caveats: make([]caveatJSON, 0, len(m.caveats)),
}