aboutsummaryrefslogtreecommitdiff
path: root/bencode
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-07-17 18:33:50 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-07-17 18:33:50 +0200
commitb58583416b944207bc4064c03a73367551872d15 (patch)
treece04fb662d9a03f6a9f6d407afbb6db61334a690 /bencode
parent12418c5c5e523d664af70d578e86b4bb9ab97918 (diff)
Duration
Diffstat (limited to 'bencode')
-rw-r--r--bencode/bdecode.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/bencode/bdecode.go b/bencode/bdecode.go
index e542f9b..0b4fe75 100644
--- a/bencode/bdecode.go
+++ b/bencode/bdecode.go
@@ -121,6 +121,8 @@ func (d *decodeState) unmarshalInt(v reflect.Value) error {
case time.Time:
t := time.Unix(i, 0)
v.Set(reflect.ValueOf(t))
+ case time.Duration:
+ v.SetInt(i * int64(time.Second))
case bool:
v.SetBool(i == 1)
default: