regexp.Match
or related in a loop SCC-SA6000Compile parses a regular expression and returns, if successful, a Regexp object that can be used to match against text.
When matching in a loop, use regexp.Compile
instead.
append
can be combined into a single call CRT-P0001Multiple calls for append
could be combined into a single call for append
.
When a param big in size (more than 80 bytes) is passed to another function, it is better to pass a pointer to the value around, rather than the value itself.
strings.Index
call cause unwanted allocations CRT-P0004[]byte
to string
conversion is required when passing the arguments to
strings.Index
, leading to unwanted allocations. It is preferred to use calls
that prevent (or minimize) such allocations (e.g., bytes.Index
, etc.).
range
CRT-P0005Use pointer to slice
or array
, to avoid copying the value that is ranged
over.