forked from TrueCloudLab/restic
Make ID.Str() handle nil ids correctly
This commit is contained in:
parent
2abda75404
commit
702b6cfc1e
1 changed files with 3 additions and 0 deletions
|
@ -38,6 +38,9 @@ func (id ID) String() string {
|
||||||
const shortStr = 4
|
const shortStr = 4
|
||||||
|
|
||||||
func (id ID) Str() string {
|
func (id ID) Str() string {
|
||||||
|
if id == nil {
|
||||||
|
return "[nil]"
|
||||||
|
}
|
||||||
return hex.EncodeToString(id[:shortStr])
|
return hex.EncodeToString(id[:shortStr])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue