aboutsummaryrefslogtreecommitdiff
path: root/meta/file.go
diff options
context:
space:
mode:
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)
+}