Skip to content

Commit

Permalink
fix(lint) Use errors instead of fmt when possible
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre PÉRONNET <[email protected]>
  • Loading branch information
holyhope committed Feb 8, 2024
1 parent 1cf45a2 commit 5f50c60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions login/chrome/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var chromeOpts = []cu.Option{ //nolint:gochecknoglobals
},
}

var errNegativeFreq = fmt.Errorf("frequency must be positive")
var errNegativeFreq = errors.New("frequency must be positive")

func WithRefreshFrequency(frequency time.Duration) login.Option { //nolint:ireturn
return &withRefreshFrequency{Frequency: frequency}
Expand Down Expand Up @@ -56,7 +56,7 @@ func (o *withRefreshFrequency) Validate() error {
return nil
}

var errNegativeTimeout = fmt.Errorf("timeout must be positive")
var errNegativeTimeout = errors.New("timeout must be positive")

func WithTimeout(timeout time.Duration) login.Option { //nolint:ireturn
return &withTimeout{Timeout: timeout}
Expand Down
3 changes: 2 additions & 1 deletion login/chrome/screen_otp.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package chrome

import (
"context"
"errors"
"fmt"
"time"

Expand Down Expand Up @@ -36,7 +37,7 @@ func (s *otpScreen) CurrentPageMatches(ctx context.Context) bool {
return len(nodeIDs) > 0
}

var errEmptyOTP = fmt.Errorf("empty OTP secret")
var errEmptyOTP = errors.New("empty OTP secret")

func (s *otpScreen) Do(ctx context.Context) error {
if s.Secret == "" {
Expand Down

0 comments on commit 5f50c60

Please sign in to comment.