diff --git a/decor/eta.go b/decor/eta.go index 3bb7fa1..5761617 100644 --- a/decor/eta.go +++ b/decor/eta.go @@ -21,6 +21,9 @@ // // `wcc` optional WC config func ETA(style int, age float64, sbCh chan time.Time, wcc ...WC) Decorator { + if sbCh == nil { + panic("start block channel must not be nil") + } var wc WC for _, widthConf := range wcc { wc = widthConf diff --git a/decor/speed.go b/decor/speed.go index 01f6c2b..82afdcc 100644 --- a/decor/speed.go +++ b/decor/speed.go @@ -182,6 +182,9 @@ } func speed(unit int, unitFormat string, age float64, sbCh chan time.Time, wcc ...WC) Decorator { + if sbCh == nil { + panic("start block channel must not be nil") + } var wc WC for _, widthConf := range wcc { wc = widthConf