You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func (p *parser) discardDirectiveWhileParsingTypes(pkg *types.Package) {
for {
switch p.tok {
case ';':
return
case '<':
p.parseType(p.pkg)
case scanner.EOF:
p.error("unexpected EOF")
default:
p.next()
}
}
}
This seems off. Either we want to use pkg instead of p.pkg, or the parameter is unnecessary. I would assume the former is the correct solution, but opening this issue first to confirm that.
It seems most of parser methods take pkg *types.Package as first parameter. I've looked at the call graph, and if you trace it back to where it's being provided, it all comes from p.pkg. So in a way, all those pkg parameters are largely redundant.
Doing anything about that is probably out of scope for that CL, because you'd need to know what the owner of the code is planning to do next, but I just wanted to point this out.
In
go/src/go/internal/gccgoimporter/parser.go
Line 736 in d445136
This seems off. Either we want to use
pkg
instead ofp.pkg
, or the parameter is unnecessary. I would assume the former is the correct solution, but opening this issue first to confirm that.Found via https://github.com/mvdan/unparam.
The text was updated successfully, but these errors were encountered: