Skip to content

Commit

Permalink
Remove redundant variable declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear committed Oct 21, 2024
1 parent e9539f2 commit 6f99c60
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 6f99c60

Please sign in to comment.