Skip to content

Commit

Permalink
(dev): removed panic
Browse files Browse the repository at this point in the history
regexp.Compile changed to regexp.MustCompile

panic moved into regexp library
  • Loading branch information
yusufpapurcu committed Jul 28, 2021
1 parent 017d14f commit 37aa091
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions filterbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package postgrest
import (
"encoding/json"
"fmt"
"log"
"regexp"
"strings"
)
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 37aa091

Please sign in to comment.