]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: make "imported and not used" errors deterministic
authorJosh Bleecher Snyder <josharian@gmail.com>
Tue, 9 May 2017 15:22:43 +0000 (08:22 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Tue, 9 May 2017 21:14:56 +0000 (21:14 +0000)
commit9fda4df9a0d3ef2dd0dc649e174992bc2d2f8db2
treebd61fe3da2d70ef9cca306fed2c276f49d62f980
parentfb0ccc5d0ac41edc545a877691d84bbb86801a07
cmd/compile: make "imported and not used" errors deterministic

If there were more unused imports than
the maximum default number of errors to report,
the set of reported imports was non-deterministic.

Fix by accumulating and sorting them prior to output.

Fixes #20298

Change-Id: Ib3d5a15fd7dc40009523fcdc1b93ddc62a1b05f2
Reviewed-on: https://go-review.googlesource.com/42954
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/gc/main.go
src/go/types/stdlib_test.go
test/fixedbugs/issue20298.go [new file with mode: 0644]