golang/go

x/text: potential Ineffective Assignments in a few packages

开放

#35,136 创建于 2019年10月24日

 (6 条评论) (0 个反应) (0 位负责人)Go (19,008 个派生)batch import
NeedsInvestigationhelp wanted

仓库指标

星标
 (133,883 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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.)

贡献者指南