proposal: ignore stale information in go list -find -json

52 views
Skip to first unread message

Manlio Perillo

unread,
May 12, 2021, 4:11:14 AM5/12/21
to golang-nuts
The go list `-find` flag was introduced to skip resolving imports.
However, is it really necessary to include stale information in this case?

Getting stale information is not a trivial work, AFAIK.
Is it ok to change the meaning of an existing flag?

Thanks
Manlio

Bryan C. Mills

unread,
May 12, 2021, 10:49:04 AM5/12/21
to golang-nuts
https://golang.org/issue/29666 (still open) is the general issue for avoiding unnecessary work in 'go list'.

It isn't obvious to me which kind of stale information we can omit for 'go list -find' in particular.

Manlio Perillo

unread,
May 12, 2021, 12:31:36 PM5/12/21
to golang-nuts
I was suggesting to not use work.Builder in the go list command, even in case the -json flag is specified or the -f flag contains the ".Stale" string.

I'm not sure about the -f flag, however, since it is an explicit request from the user.  On the other hand, if the user specified the -find flag, probably don't really want expensive data.

As for the -json flag, it may be considered a change to the public API, but I'm not sure.

Thanks.

Reply all
Reply to author
Forward
0 new messages