Skip to content

Commit 1493a38

Browse files
Replace incorrect use of fmt.Errorf
This commit replaces incorrect use of fmt.Errorf with errors.New in silence.go. Signed-off-by: George Robinson <[email protected]>
1 parent 730bd75 commit 1493a38

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

silence/silence.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ import (
4444
)
4545

4646
// ErrNotFound is returned if a silence was not found.
47-
var ErrNotFound = fmt.Errorf("silence not found")
47+
var ErrNotFound = errors.New("silence not found")
4848

4949
// ErrInvalidState is returned if the state isn't valid.
50-
var ErrInvalidState = fmt.Errorf("invalid state")
50+
var ErrInvalidState = errors.New("invalid state")
5151

5252
type matcherCache map[*pb.Silence]labels.Matchers
5353

@@ -338,7 +338,7 @@ type Options struct {
338338

339339
func (o *Options) validate() error {
340340
if o.SnapshotFile != "" && o.SnapshotReader != nil {
341-
return fmt.Errorf("only one of SnapshotFile and SnapshotReader must be set")
341+
return errors.New("only one of SnapshotFile and SnapshotReader must be set")
342342
}
343343
return nil
344344
}

0 commit comments

Comments
 (0)