-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
go.dev: change "copy" link to be full import statement #36809
Comments
/cc @jba |
We did that because most of the time, the file in which you'd like to paste the result already has an import block, with parens. But perhaps we're missing other use cases of this feature? |
If this is the case, then I think making the copied value However I'm not clear that "most of the time" there will be an existing import declaration group (if that's the name given to a Regardless, if the copied value is |
Let me ask you: why is |
Because I can paste it directly into any |
Sounds reasonable. Will do. |
This has been fixed and will appear after the next deployment, sometime next week. |
Live now. |
Thank you! |
The copy button at the top of a details page now puts import "path" on the clipboard, rather than just path. This makes it easier to simply paste the result into Go code. Fixes golang/go#36809. Change-Id: I52360a3d1a02214b10a27d39f9d0b2ddad7e0d4e Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/665367 CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com> Reviewed-by: Julie Qiu <julieqiu@google.com>
The copy button at the top of a details page now puts just the path on the clipboard, rather than import "path" Updates golang/go#36809. Updates golang/go#38514. Change-Id: I7f475d0415f67a4ff72e95abef750d2604717a51 Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/722967 Reviewed-by: Julie Qiu <julieqiu@google.com>
What is the URL of the page with the issue?
https://pkg.go.dev/testing?tab=doc
What is your user agent?
Screenshot
What did you do?
Visited the above page.
What did you expect to see?
Firstly, the presence of the "copy" link to the right of the package path is welcomed: thank you!
However, godoc has this nice feature whereby the first thing at the top of the page is a complete import statement:
I'd like to suggest that we change pkg.go.dev to behave in the same way, such that clicking on the "copy" link would result in the following contents on the clipboard:
What did you see instead?
Only
testing
is copied to the clipboard.The text was updated successfully, but these errors were encountered: