Skip to content

Commit

Permalink
fix some go-lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
chunriyeqiongsaigao committed Aug 21, 2023
1 parent 27961f0 commit f2f0acd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions commands/verify/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,10 @@ func DoVerifyAccordingConfig() error {
concurrency := e2eConfig.Verify.Concurrency
if concurrency {
// enable batch output mode when concurrency is enabled
printer = output.NewPrinter(output.WithBatchOutput(true))
printer = output.NewPrinter(output.WithBatchMod(true))
return verifyCasesConcurrently(&e2eConfig.Verify, &VerifyInfo)
}
printer = output.NewPrinter(output.WithBatchOutput(util.BatchMode), output.WithOutputInFormat(output.Format != ""), output.WithSummaryOnly(summaryOnly))
printer = output.NewPrinter(output.WithBatchMod(util.BatchMode), output.WithFormat(output.Format != ""), output.WithSummaryOnly(summaryOnly))
return verifyCasesSerially(&e2eConfig.Verify, &VerifyInfo)
}

Expand Down
6 changes: 2 additions & 4 deletions pkg/output/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ func NewPrinter(options ...Option) Printer {

type Option func(*printer)

func WithBatchOutput(batchOutput bool) Option {
func WithBatchMod(batchOutput bool) Option {
return func(p *printer) {
p.batchOutput = batchOutput
}
}

func WithOutputInFormat(outputInFormat bool) Option {
func WithFormat(outputInFormat bool) Option {
return func(p *printer) {
p.outputInFormat = outputInFormat
}
Expand All @@ -95,7 +95,6 @@ func (p *printer) Start(msg ...string) {
}

func (p *printer) Success(msg string) {

if p.batchOutput || p.outputInFormat || p.summaryOnly {
return
}
Expand Down Expand Up @@ -144,7 +143,6 @@ func (p *printer) PrintResult(caseRes []*CaseResult) (passNum, failNum, skipNum
if p.batchOutput {
p.spinner.Warning(cr.Msg)
p.spinner.Fail(cr.Err.Error())

}
}
} else {
Expand Down

0 comments on commit f2f0acd

Please sign in to comment.