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

x/tools/go/packages: GoFiles should be sorted #36763

Closed
perillo opened this issue Jan 25, 2020 · 6 comments
Closed

x/tools/go/packages: GoFiles should be sorted #36763

perillo opened this issue Jan 25, 2020 · 6 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@perillo
Copy link
Contributor

perillo commented Jan 25, 2020

The GoFiles field in packages is the concatenation of GoFiles and CgoFiles from go list.
go list returns the two fields sorted (although it seems to not be documented), but packages does not sort its own GoFiles.

@gopherbot gopherbot added this to the Unreleased milestone Jan 25, 2020
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Jan 25, 2020
@mvdan
Copy link
Member

mvdan commented Jan 25, 2020

Could you clarify why you think this is important? Is it for consistency with go list, or to have deterministic behavior?

@perillo
Copy link
Contributor Author

perillo commented Jan 25, 2020

The order returned by packages is deterministic. It is just not the order one may expect.

@cagedmantis cagedmantis added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 3, 2020
@cagedmantis
Copy link
Contributor

/cc @matloob

@matloob
Copy link
Contributor

matloob commented Feb 5, 2020

I'd prefer not to specify the ordering of GoFiles. We want it to be deterministic but I think that otherwise, the more flexibility the api has, the better.

@perillo
Copy link
Contributor Author

perillo commented Feb 5, 2020

It seems reasonable, and go help list does not document that the files are sorted.

Thanks.

@matloob
Copy link
Contributor

matloob commented Feb 5, 2020

Okay, I'll close. Thanks!

@matloob matloob closed this as completed Feb 5, 2020
@golang golang locked and limited conversation to collaborators Feb 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

5 participants