From 37aa091547e64245a23d87b4107f7c872eb9437f Mon Sep 17 00:00:00 2001 From: Yusuf Papurcu Date: Wed, 28 Jul 2021 13:45:11 +0300 Subject: [PATCH] (dev): removed panic regexp.Compile changed to regexp.MustCompile panic moved into regexp library --- filterbuilder.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/filterbuilder.go b/filterbuilder.go index 24dd622..0b64193 100644 --- a/filterbuilder.go +++ b/filterbuilder.go @@ -3,7 +3,6 @@ package postgrest import ( "encoding/json" "fmt" - "log" "regexp" "strings" ) @@ -117,10 +116,7 @@ func (f *FilterBuilder) Is(column, value string) *FilterBuilder { func (f *FilterBuilder) In(column string, values []string) *FilterBuilder { var cleanedValues []string - illegalChars, err := regexp.Compile("[,()]") - if err != nil { - log.Panicf("Couldn't parse regexp: %+v", err) - } + illegalChars := regexp.MustCompile("[,()]") for _, value := range values { exp := illegalChars.MatchString(value) if exp {