Describe the feature
In the generated code, regexp.MustCompile is being called within the function. This leads to unnecessary recompilation on each invocation and affects performance. Maybe defining the regex at the package level (outside the function) to compile it only once.
|
reTrim := regexp.MustCompile(`(?i)^\s*(?:and|or)\s+|\s+(?:and|or)\s*$`) |