diff --git a/func.go b/func.go index e770bd5..ee0ba9a 100644 --- a/func.go +++ b/func.go @@ -180,7 +180,7 @@ func (f *funcMockerGeneratorHelper) generateMockOutputsMethod() jen.Code { Params(jen.Id("m").Op("*").Id(f.getMockerStructName())). Id("MockOutputs"). Params( - append([]jen.Code{jen.Id("nTimes").Int()}, f.generateOutputParamSignature(true)...)... + append([]jen.Code{jen.Id("nTimes").Int()}, f.generateOutputParamSignature(true)...)..., ).Block( jen.Id("m").Dot("Mock").Call( jen.Id("nTimes"), @@ -239,7 +239,7 @@ func (f *funcMockerGeneratorHelper) generateMockOutputsOnceMethod() jen.Code { Params(f.generateOutputParamSignature(true)...). Block( jen.Id("m").Dot("MockOutputs").Call( - append([]jen.Code{jen.Lit(1)}, f.generateOutputList(true)...)... + append([]jen.Code{jen.Lit(1)}, f.generateOutputList(true)...)..., ), ) } @@ -251,7 +251,7 @@ func (f *funcMockerGeneratorHelper) generateMockOutputsForeverMethod() jen.Code Params(f.generateOutputParamSignature(true)...). Block( jen.Id("m").Dot("MockOutputs").Call( - append([]jen.Code{jen.Lit(0)}, f.generateOutputList(true)...)... + append([]jen.Code{jen.Lit(0)}, f.generateOutputList(true)...)..., ), ) } @@ -262,7 +262,7 @@ func (f *funcMockerGeneratorHelper) generateMockDefaultsMethod() jen.Code { Id("MockDefaults"). Params(jen.Id("nTimes").Int()) - body := make([]jen.Code, 0, 0) + body := make([]jen.Code, 0) for i, field := range f.funcType.Outputs { body = append( diff --git a/interface.go b/interface.go index dd3c002..16ce37f 100644 --- a/interface.go +++ b/interface.go @@ -117,7 +117,7 @@ func (s *interfaceMockerGeneratorHelper) generateMockedInterfaceImpl() jen.Code } func (s *interfaceMockerGeneratorHelper) generateInterfaceMockerConstructor() jen.Code { - values := make([]jen.Code, 0, 0) + values := make([]jen.Code, 0) for _, method := range s.interfaceType.Methods { name := method.Name values = append( diff --git a/util.go b/util.go index 3193652..70cf88f 100644 --- a/util.go +++ b/util.go @@ -59,9 +59,9 @@ func parseInt(s string) (int, bool) { n := 0 for i := 0; i < len(s); i++ { switch { - case base >= 10 && s[i] >= 'a' && s[i] < 'a' + base - 10: + case base >= 10 && s[i] >= 'a' && s[i] < 'a'+base-10: n = n*int(base) + int(s[i]) - 'a' + 10 - case base >= 10 && s[i] >= 'A' && s[i] < 'A' + base - 10: + case base >= 10 && s[i] >= 'A' && s[i] < 'A'+base-10: n = n*int(base) + int(s[i]) - 'A' + 10 case s[i] >= '0' && s[i] < '0'+maxUint8(base, 10): n = n*int(base) + int(s[i]) - '0' @@ -77,7 +77,7 @@ func maxUint8(a, b uint8) uint8 { return b } -type stepFunc func() (jen.Code, ) +type stepFunc func() jen.Code func concatSteps(steps ...stepFunc) jen.Code { j := jen.Empty()