New issue
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
x/text: potential Ineffective Assignments in a few packages #35136
Comments
/cc @mpvl |
Hi, if it's possible, I would like to work on this. I had run Almost all issues can be easily fixed by simply removing or refactoring the ineffectual assignments clauses. However, there are two entries that may actually need a deeper look:
These lines are part of a port of the reference implementation of the Bidi Parentheses Algorithm (found here: https://www.unicode.org/Public/PROGRAMS/BidiReferenceJava/BidiReference.java). The original code uses
If it's ok, I can send a PR right away, fixing all issues. Here is the updated list of entries generated by
|
@filewalkwithme - thanks for volunteering to work on this ..... 18 month old issue ...... :-) |
Background: I'm a Software Security consultant, but not a Go expert. Just learning Go.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
I believe I'm using the latest version of Go.
What did you do?
I ran a free Go tool called ineffassign (from: https://github.com/gordonklaus/ineffassign) and noticed it pointed out some issues in the go libraries themselves. I asked Gordon Klaus to review them and his response was: "Some of those are harmless (if sloppy), but others look like they might be real bugs. I think they're worth reporting at golang.org/issues."
What did you expect to see?
No issues pointed out in Go libraries by this tool.
What did you see instead?
I ran ineffassign on a Go app I'm doing a security review for and noticed these results as part of the output:
mpapp/vendor/golang.org/x/text/collate/build/colelem.go:205:5: ineffectual assignment to p
mpapp/vendor/golang.org/x/text/collate/maketables.go:449:4: ineffectual assignment to d
mpapp/vendor/golang.org/x/text/transform/transform.go:146:5: ineffectual assignment to err
mpapp/vendor/golang.org/x/text/unicode/bidi/core.go:489:5: ineffectual assignment to preceedingCharacterType
mpapp/vendor/golang.org/x/text/unicode/bidi/core.go:565:4: ineffectual assignment to i
mpapp/vendor/golang.org/x/text/unicode/bidi/core.go:644:4: ineffectual assignment to i
mpapp/vendor/golang.org/x/text/unicode/cldr/resolve.go:486:7: ineffectual assignment to err
These look like part of Go itself, so I find them interesting. Do you think these are real issues that need to be reported to the maintainers of Go? Or false positives? (Gordon said report them, so here they are.)
The text was updated successfully, but these errors were encountered: