Skip to content

Commit

Permalink
Merge pull request #829 from alexandear/refactor/redundant-var-decl
Browse files Browse the repository at this point in the history
Remove redundant variable declarations
  • Loading branch information
LandonTClipp authored Oct 21, 2024
2 parents 33886a9 + 6f99c60 commit 146f48b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
1 change: 0 additions & 1 deletion cmd/mockery.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ func GetRootAppFromViper(v *viper.Viper) (*RootApp, error) {
func (r *RootApp) Run() error {
var recursive bool
var filter *regexp.Regexp
var err error
var limitOne bool

if r.Quiet {
Expand Down
7 changes: 1 addition & 6 deletions pkg/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ func (s *GeneratorSuite) checkGenerationWithConfig(
// it would require changing Write's signature to accept custom options, specifically to
// allow the fragments in preexisting cases. It's assumed that this approximation,
// just formatting the source, is sufficient for the needs of the current test styles.
var actual []byte
actual, fmtErr := format.Source(generator.buf.Bytes())
s.Require().NoError(fmtErr)

Expand Down Expand Up @@ -108,7 +107,6 @@ func (s *GeneratorSuite) checkGenerationRegexWithConfig(
// it would require changing Write's signature to accept custom options, specifically to
// allow the fragments in preexisting cases. It's assumed that this approximation,
// just formatting the source, is sufficient for the needs of the current test styles.
var actual []byte
actual, fmtErr := format.Source(generator.buf.Bytes())
s.Require().NoError(fmtErr)

Expand Down Expand Up @@ -183,7 +181,6 @@ func (s *GeneratorSuite) TestGeneratorExpecterWithRolledVariadic() {
)
s.Require().NoError(generator.Generate(s.ctx))

var actual []byte
actual, fmtErr := format.Source(generator.buf.Bytes())
s.Require().NoError(fmtErr)

Expand Down Expand Up @@ -418,7 +415,6 @@ func (s *GeneratorSuite) TestGeneratorVariadicArgsAsOneArg() {
)
s.Require().NoError(generator.Generate(s.ctx))

var actual []byte
actual, fmtErr := format.Source(generator.buf.Bytes())
s.Require().NoError(fmtErr)

Expand Down Expand Up @@ -619,8 +615,7 @@ func (s *GeneratorSuite) TestGeneratorForStructValueReturn() {

func (s *GeneratorSuite) TestGeneratorForStructWithTag() {
// StructTag has back-quote, So can't use raw string literals in this test case.
var expected string
expected += "*struct {"
expected := "*struct {"
expected += "FieldC int `json:\"field_c\"`"
expected += "FieldD int `json:\"field_d\" xml:\"field_d\"`"
expected += "}"
Expand Down

0 comments on commit 146f48b

Please sign in to comment.