From edf3f836e8c2dd89c4a6fc7817b124dc3f6e8089 Mon Sep 17 00:00:00 2001 From: Eliot Whalan Date: Fri, 15 Jul 2016 14:42:51 +1000 Subject: [PATCH] Add fallthrough --- pastebin.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pastebin.go b/pastebin.go index 601d52b..f0315a2 100644 --- a/pastebin.go +++ b/pastebin.go @@ -108,6 +108,9 @@ func Sha1(paste string) string { // DurationFromExpiry takes the expiry in string format and returns the duration // that the paste will exist for func DurationFromExpiry(expiry string) time.Duration { + if expiry == "" { + expiry = "P20Y" + } dura, err := duration.FromString(expiry) // dura is time.Duration type Check(err)