Add fallthrough
This commit is contained in:
parent
65624b1874
commit
1dbd948eec
|
@ -108,6 +108,9 @@ func Sha1(paste string) string {
|
||||||
// DurationFromExpiry takes the expiry in string format and returns the duration
|
// DurationFromExpiry takes the expiry in string format and returns the duration
|
||||||
// that the paste will exist for
|
// that the paste will exist for
|
||||||
func DurationFromExpiry(expiry string) time.Duration {
|
func DurationFromExpiry(expiry string) time.Duration {
|
||||||
|
if expiry == "" {
|
||||||
|
expiry = "P20Y"
|
||||||
|
}
|
||||||
dura, err := duration.FromString(expiry) // dura is time.Duration type
|
dura, err := duration.FromString(expiry) // dura is time.Duration type
|
||||||
Check(err)
|
Check(err)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue