gofmt: Convert URLs to import paths #39324
Labels
FrozenDueToAge
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
This is really a feature request, so I'm tweaking the issue template slightly.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Visit https://github.com/spf13/viper, copy the URL from my address bar and paste it into an import block:
Then I hit save (which auto-runs
gofmt
).What did you see?
Sublime, (or a plugin, more accurately) threw down a red underline and told me I had an invalid import path.
What would you like to see?
I think it would be handy if
gofmt
could remove thehttps://
, or any scheme, automatically. (I can't think of a scenario where a scheme is valid in an import block.). This way you can straight copy a URL from an address bar, paste it in, format and move on.I know that https://pkg.go.dev has a little Copy button to get just the import path, which is great for pasting into an import block, but often I'm just browsing GitHub and want to pull in that repo, and this would facilitate.
The text was updated successfully, but these errors were encountered: