aboutsummaryrefslogtreecommitdiff
path: root/meta/file.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-07-06 11:26:17 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-07-06 11:26:17 +0200
commit35d77e5837cc00ca2601b31aa549f7b7f6779ccb (patch)
treeb2bafbf7643a06721c8c98a522cf52d1d8e1598b /meta/file.go
parent05296aa99672db4ab512995356602fde5ac58b4f (diff)
wip
Diffstat (limited to 'meta/file.go')
-rw-r--r--meta/file.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/meta/file.go b/meta/file.go
index 2ec14cb..8a5a382 100644
--- a/meta/file.go
+++ b/meta/file.go
@@ -1,6 +1,9 @@
package meta
-import "path"
+import (
+ "fmt"
+ "path"
+)
type File struct {
Length int `bencode:"length"`
@@ -11,3 +14,7 @@ type File struct {
func (f File) Name() string {
return path.Join(f.Path...)
}
+
+func (f File) String() string {
+ return fmt.Sprintf("%v (%d)", f.Name(), f.Length)
+}