-
Notifications
You must be signed in to change notification settings - Fork 111
Open
Description
The use of regex.MustCompile (see:
Lines 354 to 360 in daf92ba
| func compileRegex(flags, expr string) *regexp.Regexp { | |
| if flags == "" { | |
| return regexp.MustCompile(expr) | |
| } else { | |
| return regexp.MustCompile(fmt.Sprintf("(?%s)%s", flags, expr)) | |
| } | |
| } |
We pull down the master regex url daily, so that our regexes are always up to date, and load it right into our servers. The panic cause all our servers to crash last night, until we pinned the master regex url to a working version.
NewFromBytes already has the option to return an error, so why not return the error there?
Lines 209 to 219 in daf92ba
| func NewFromBytes(data []byte) (*Parser, error) { | |
| var definitions RegexesDefinitions | |
| if err := yaml.Unmarshal(data, &definitions); err != nil { | |
| return nil, err | |
| } | |
| parser := &Parser{definitions, 0, 0, 0, (EOsLookUpMode|EUserAgentLookUpMode|EDeviceLookUpMode), false, false} | |
| parser.mustCompile() | |
| return parser, nil | |
| } |
jkw-statsig and otraore
Metadata
Metadata
Assignees
Labels
No labels