I tried to apply decorators from this famous Golang decorators talk but it only works for him because all the functions he's decorating are attached to a struct, and he's just decorating one Do() function. Every other tutorial I've seen also does it this way, which is quite annoying.
I want to decorate these functions with a base58/64 encoder function
func SpendTx(senderID, recipientID string, amount, fee utils.BigInt, payload string, ttl, nonce uint64) (rlpRawMsg []byte, err error)
func NamePreclaimTx(accountID, commitmentID string, fee uint64, ttl, nonce uint64) (rlpRawMsg []byte, err error)
func NameClaimTx(accountID, name string, nameSalt, fee uint64, ttl, nonce uint64) (rlpRawMsg []byte, err error)
...
As you can see, the arguments are all different, and they are also pure functions, not attached to a struct. But they all return []byte and an error, so this should be possible.