From 0127b3aafeb23a6031687bf47964dda9e30784c0 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Fri, 12 Sep 2014 08:38:59 -0500 Subject: [PATCH] Make ErrHashStrSize slightly more descriptive. Add the word 'string' to the error string so if this is printed, it will be clearer that it was a hash string decode that failed (as opposed to other errors creating a ShaHash from a byte slice) and change 'chars' to 'bytes', since the string length is measured in bytes, not UTF-8 code points. ok @davecgh --- shahash.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shahash.go b/shahash.go index b6ac8d11..1e3f8f21 100644 --- a/shahash.go +++ b/shahash.go @@ -18,7 +18,7 @@ const MaxHashStringSize = HashSize * 2 // ErrHashStrSize describes an error that indicates the caller specified a hash // string that has too many characters. -var ErrHashStrSize = fmt.Errorf("max hash length is %v chars", MaxHashStringSize) +var ErrHashStrSize = fmt.Errorf("max hash string length is %v bytes", MaxHashStringSize) // ShaHash is used in several of the bitcoin messages and common structures. It // typically represents the double sha256 of data.