Make ID.Str() handle nil ids correctly

This commit is contained in:
Alexander Neumann committed 2015-03-28 16:46:21 +01:00
1 parent 2abda75404
commit 702b6cfc1e
1 file changed
+3
+3
View File
@@ -38,6 +38,9 @@ func (id ID) String() string {
const shortStr = 4
func (id ID) Str() string {
if id == nil {
return "[nil]"
}
return hex.EncodeToString(id[:shortStr])
}