From db32fab6128f00da2905d6cda076147b0e241831 Mon Sep 17 00:00:00 2001 From: George Robinson Date: Thu, 20 Jun 2024 12:02:05 +0100 Subject: [PATCH] Replace incorrect use of fmt.Errorf (#3883) --- silence/silence.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/silence/silence.go b/silence/silence.go index 6b67b2ca..c837e6fa 100644 --- a/silence/silence.go +++ b/silence/silence.go @@ -44,10 +44,10 @@ import ( ) // ErrNotFound is returned if a silence was not found. -var ErrNotFound = fmt.Errorf("silence not found") +var ErrNotFound = errors.New("silence not found") // ErrInvalidState is returned if the state isn't valid. -var ErrInvalidState = fmt.Errorf("invalid state") +var ErrInvalidState = errors.New("invalid state") type matcherCache map[*pb.Silence]labels.Matchers @@ -338,7 +338,7 @@ type Options struct { func (o *Options) validate() error { if o.SnapshotFile != "" && o.SnapshotReader != nil { - return fmt.Errorf("only one of SnapshotFile and SnapshotReader must be set") + return errors.New("only one of SnapshotFile and SnapshotReader must be set") } return nil }