Skip to content

Commit

Permalink
make use of LoadAllSyntax compatible with the latest x/tools version
Browse files Browse the repository at this point in the history
  • Loading branch information
sitano authored and jirfag committed Apr 2, 2019
1 parent 97ea1cb commit de1d1ad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/lint/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ func stringifyLoadMode(mode packages.LoadMode) string {
return "load types"
case packages.LoadSyntax:
return "load types and syntax"
case packages.LoadAllSyntax:
}
// it may be an alias, and may be not
if mode == packages.LoadAllSyntax {
return "load deps types and syntax"
}
return "unknown"
Expand Down

2 comments on commit de1d1ad

@leonklingele
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

@matloob
Copy link

@matloob matloob commented on de1d1ad Apr 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leonklingele : I made the change that broke this (sorry!)

LoadAllSyntax and LoadSyntax are now the equal in x/tools/go/packages, and the Go compiler will object to two identical switch cases, so that change breaks the compilation of this code.

Though I think more accurate solution would be to use the Need* bits instead...

Please sign in to comment.