From b522844dfff92017f9fff9e78b1bcf34202b8307 Mon Sep 17 00:00:00 2001 From: Jonathan Ingram Date: Wed, 27 Apr 2022 12:25:19 +1000 Subject: [PATCH] all: use xerrors --- filtering/errors.go | 3 ++- filtering/lexer.go | 3 ++- filtering/parser.go | 3 ++- go.mod | 2 +- pagination/struct.go | 3 ++- validation/messagevalidator.go | 3 ++- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/filtering/errors.go b/filtering/errors.go index 2d19070e27..70285378ff 100644 --- a/filtering/errors.go +++ b/filtering/errors.go @@ -1,9 +1,10 @@ package filtering import ( - "errors" "fmt" "strings" + + errors "golang.org/x/xerrors" ) type filterError interface { diff --git a/filtering/lexer.go b/filtering/lexer.go index a57db8ed74..65c7d063e7 100644 --- a/filtering/lexer.go +++ b/filtering/lexer.go @@ -1,11 +1,12 @@ package filtering import ( - "errors" "fmt" "io" "unicode" "unicode/utf8" + + errors "golang.org/x/xerrors" ) // Lexer is a filter expression lexer. diff --git a/filtering/parser.go b/filtering/parser.go index b54775b6bd..67da9f5261 100644 --- a/filtering/parser.go +++ b/filtering/parser.go @@ -1,12 +1,13 @@ package filtering import ( - "errors" "fmt" "io" "strconv" "strings" + errors "golang.org/x/xerrors" + expr "google.golang.org/genproto/googleapis/api/expr/v1alpha1" ) diff --git a/go.mod b/go.mod index f989bbd348..bd59e24615 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.17 require ( github.com/google/uuid v1.3.0 github.com/stoewer/go-strcase v1.2.0 + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 google.golang.org/genproto v0.0.0-20220111164026-67b88f271998 google.golang.org/grpc v1.40.1 google.golang.org/protobuf v1.27.1 @@ -17,5 +18,4 @@ require ( golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect golang.org/x/sys v0.0.0-20210510120138-977fb7262007 // indirect golang.org/x/text v0.3.5 // indirect - golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect ) diff --git a/pagination/struct.go b/pagination/struct.go index f914a2a7b2..7fbcbd5c0c 100644 --- a/pagination/struct.go +++ b/pagination/struct.go @@ -3,10 +3,11 @@ package pagination import ( "encoding/base64" "encoding/gob" - "errors" "fmt" "io" "strings" + + errors "golang.org/x/xerrors" ) // EncodePageTokenStruct encodes an arbitrary struct as a page token. diff --git a/validation/messagevalidator.go b/validation/messagevalidator.go index 1433a39f26..2620f6eb20 100644 --- a/validation/messagevalidator.go +++ b/validation/messagevalidator.go @@ -1,10 +1,11 @@ package validation import ( - "errors" "fmt" "strings" + errors "golang.org/x/xerrors" + "google.golang.org/genproto/googleapis/rpc/errdetails" )