We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In the following function, prealloc is confused by buf being redeclared:
prealloc
buf
func copySort(w io.Writer, r io.Reader, sep rune, keys []int) error { // Copy the header line. var buf [1]byte // THATS LINE 275 WHERE THE ERROR MESSAGES POINT TO for { n, err := r.Read(buf[:]) if n != 0 { if _, err := w.Write(buf[:]); err != nil { return err } } if err != nil { if err == io.EOF { return nil } return err } if buf[0] == '\n' { break } } ... for i, k := range keys { buf := make([]byte, 0, 16) buf = append(buf, "-k"...) n := int64(1 + k) buf = strconv.AppendInt(buf, n, 10) buf = append(buf, ',') buf = strconv.AppendInt(buf, n, 10) args[2+i] = alloc.DirectString(buf) } ... }
preallocreports these 2 error messages:
...:275 Consider preallocating buf ...:275 Consider preallocating buf
If I rename the first buf declaration with any other variable name (e.g., cell) the error messages disappear.
cell
It seems a variable redeclaration is not always managed correctly by prealloc.
The text was updated successfully, but these errors were encountered:
Interesting.. I'll try to look into this ASAP.
Sorry, something went wrong.
No branches or pull requests
In the following function,
prealloc
is confused bybuf
being redeclared:prealloc
reports these 2 error messages:If I rename the first
buf
declaration with any other variable name (e.g.,cell
) the error messages disappear.It seems a variable redeclaration is not always managed correctly by
prealloc
.The text was updated successfully, but these errors were encountered: