Skip to content

Commit

Permalink
Merge branch 'master' into support-embedded-interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Jauhar Arifin committed Jul 10, 2020
2 parents 036322c + ab707bd commit 8f61a4d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions func.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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)...)...,
),
)
}
Expand All @@ -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)...)...,
),
)
}
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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()
Expand Down

0 comments on commit 8f61a4d

Please sign in to comment.