package meta import ( "fmt" "path" ) type File struct { Length int64 `bencode:"length"` MD5Sum []byte `bencode:"md5sum,optional"` // never seen in wildlife Path []string `bencode:"path"` } func (f File) Name() string { return path.Join(f.Path...) } func (f File) String() string { return fmt.Sprintf("%v (%d)", f.Name(), f.Length) }