From b07fbf65b5badc6af93c8ca804acce8f7186c8c6 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 12 Jun 2016 13:49:57 +0200 Subject: minor cleanup --- meta/torrent.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'meta') diff --git a/meta/torrent.go b/meta/torrent.go index 9a63fa8..33eebd2 100644 --- a/meta/torrent.go +++ b/meta/torrent.go @@ -28,8 +28,11 @@ type Info struct { func (i Info) String() string { var s string - for _, f := range i.Files { - s += fmt.Sprintln(f) + if l := len(i.Files); l > 0 { + s += fmt.Sprintln("files:", l) + for _, f := range i.Files { + s += fmt.Sprintln(f) + } } s += fmt.Sprintf("%s (%d)\n", i.Name, i.Length) s += fmt.Sprintf("chunks: %d * %d + %d\n", @@ -54,7 +57,7 @@ func (t Torrent) String() string { s := fmt.Sprintf("announce: %s\n", t.Announce) s += fmt.Sprintf("comment: %s\n", t.Comment) s += fmt.Sprintf("date: %s\n", t.CreationDate) - s += fmt.Sprintf("info: %v", t.Info) + s += fmt.Sprintf("%v", t.Info) s += fmt.Sprintf("info hash: %x", t.InfoHash) return s } -- cgit v1.2.3