From fb4c64910d60632d221f16d9eca503db3ccd1c29 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Thu, 12 Jun 2014 20:11:24 -0500 Subject: [PATCH] Make Address a fmt.Stringer. --- address.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/address.go b/address.go index 295d565..3aaedc5 100644 --- a/address.go +++ b/address.go @@ -55,7 +55,19 @@ func encodeAddress(hash160 []byte, netID byte) string { // enough that other kinds of addresses may be added in the future without // changing the decoding and encoding API. type Address interface { - // EncodeAddress returns the string encoding of the address. + // String returns the string encoding of the transaction output + // destination. + // + // Please note that String differs subtly from EncodeAddress: String + // will return the value as a string without any conversion, while + // EncodeAddress may convert destination types (for example, + // converting pubkeys to P2PKH addresses) before encoding as a + // payment address string. + String() string + + // EncodeAddress returns the string encoding of the payment address + // associated with the Address value. See the comment on String + // for how this method differs from String. EncodeAddress() string // ScriptAddress returns the raw bytes of the address to be used