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.).
strings.Index(string(x), y)
bytes.Index(x, []byte(y))