1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-23 08:16:36 +00:00

Fix panic for debug.Log() with empty string

This commit is contained in:
Alexander Neumann 2016-08-28 22:42:46 +02:00
parent 6f5bf45212
commit f51bc8e9b9

View file

@ -146,7 +146,7 @@ func Log(tag string, f string, args ...interface{}) {
current := time.Now()
opts.last[process{tag, goroutine}] = current
if f[len(f)-1] != '\n' {
if len(f) == 0 || f[len(f)-1] != '\n' {
f += "\n"
}