Skip to content
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

go/types: randomly ordered 'declared but not used' errors #22525

Closed
rsc opened this issue Nov 1, 2017 · 1 comment
Closed

go/types: randomly ordered 'declared but not used' errors #22525

rsc opened this issue Nov 1, 2017 · 1 comment
Assignees
Milestone

Comments

@rsc
Copy link
Contributor

@rsc rsc commented Nov 1, 2017

$ cat x.go
package p

func f() {
	var a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z int
}
$ gotype x.go
x.go:4:54: q declared but not used
x.go:4:6: a declared but not used
x.go:4:9: b declared but not used
x.go:4:18: e declared but not used
x.go:4:21: f declared but not used
x.go:4:42: m declared but not used
x.go:4:15: d declared but not used
x.go:4:36: k declared but not used
x.go:4:51: p declared but not used
x.go:4:57: r declared but not used
$ gotype x.go
x.go:4:6: a declared but not used
x.go:4:15: d declared but not used
x.go:4:30: i declared but not used
x.go:4:42: m declared but not used
x.go:4:48: o declared but not used
x.go:4:51: p declared but not used
x.go:4:66: u declared but not used
x.go:4:69: v declared but not used
x.go:4:75: x declared but not used
x.go:4:81: z declared but not used
$ gotype x.go
x.go:4:21: f declared but not used
x.go:4:30: i declared but not used
x.go:4:51: p declared but not used
x.go:4:63: t declared but not used
x.go:4:72: w declared but not used
x.go:4:75: x declared but not used
x.go:4:69: v declared but not used
x.go:4:78: y declared but not used
x.go:4:6: a declared but not used
x.go:4:9: b declared but not used
$ 

The reordering happens for single declarations on different lines too. Looks like there is a sort needed somewhere after a map iteration.

(This issue and #22524 matter for Go 1.10 because vet is going to start reporting errors from go/types.)

/cc @griesemer

@rsc rsc added this to the Go1.10 milestone Nov 1, 2017
@mvdan mvdan self-assigned this Nov 1, 2017
@gopherbot
Copy link

@gopherbot gopherbot commented Nov 1, 2017

Change https://golang.org/cl/75090 mentions this issue: go/types: sort unused declaration errors

Loading

@gopherbot gopherbot closed this in 1852573 Nov 1, 2017
@golang golang locked and limited conversation to collaborators Nov 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants