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

Comments

@perillo
Copy link

@perillo 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 label Jan 25, 2020
@mvdan

This comment has been minimized.

Copy link
Member

@mvdan 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

This comment has been minimized.

Copy link
Author

@perillo perillo commented Jan 25, 2020

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

@cagedmantis

This comment has been minimized.

Copy link
Contributor

@cagedmantis cagedmantis commented Feb 3, 2020

/cc @matloob

@matloob

This comment has been minimized.

Copy link
Contributor

@matloob 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

This comment has been minimized.

Copy link
Author

@perillo perillo commented Feb 5, 2020

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

Thanks.

@matloob

This comment has been minimized.

Copy link
Contributor

@matloob matloob commented Feb 5, 2020

Okay, I'll close. Thanks!

@matloob matloob closed this Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.