diff --git a/decor/counters.go b/decor/counters.go index 5e26324..6bcee79 100644 --- a/decor/counters.go +++ b/decor/counters.go @@ -2,7 +2,6 @@ import ( "fmt" - "strings" ) // CountersNoUnit is a wrapper around Counters with no unit param. @@ -41,8 +40,6 @@ func Counters(unit interface{}, pairFmt string, wcc ...WC) Decorator { if pairFmt == "" { pairFmt = "%d / %d" - } else if strings.Count(pairFmt, "%") != 2 { - panic("expected pairFmt with exactly 2 verbs") } producer := func() DecorFunc { switch unit.(type) { @@ -99,8 +96,6 @@ func Total(unit interface{}, format string, wcc ...WC) Decorator { if format == "" { format = "%d" - } else if strings.Count(format, "%") != 1 { - panic("expected format with exactly 1 verb") } producer := func() DecorFunc { switch unit.(type) { @@ -157,8 +152,6 @@ func Current(unit interface{}, format string, wcc ...WC) Decorator { if format == "" { format = "%d" - } else if strings.Count(format, "%") != 1 { - panic("expected format with exactly 1 verb") } producer := func() DecorFunc { switch unit.(type) { @@ -215,8 +208,6 @@ func InvertedCurrent(unit interface{}, format string, wcc ...WC) Decorator { if format == "" { format = "%d" - } else if strings.Count(format, "%") != 1 { - panic("expected format with exactly 1 verb") } producer := func() DecorFunc { switch unit.(type) { diff --git a/decor/speed.go b/decor/speed.go index 448aac7..60ffefb 100644 --- a/decor/speed.go +++ b/decor/speed.go @@ -4,7 +4,6 @@ "fmt" "io" "math" - "strings" "time" "github.com/VividCortex/ewma" @@ -70,8 +69,6 @@ func MovingAverageSpeed(unit interface{}, format string, average ewma.MovingAverage, wcc ...WC) Decorator { if format == "" { format = "%.0f" - } else if strings.Count(format, "%") != 1 { - panic("expected format with exactly 1 verb") } d := &movingAverageSpeed{ WC: initWC(wcc...), @@ -133,8 +130,6 @@ func NewAverageSpeed(unit interface{}, format string, startTime time.Time, wcc ...WC) Decorator { if format == "" { format = "%.0f" - } else if strings.Count(format, "%") != 1 { - panic("expected format with exactly 1 verb") } d := &averageSpeed{ WC: initWC(wcc...),