mirror of https://github.com/golang/go.git
Modifying go.mod files directly leaves go.sum unchanged, and therefore in need of updates later. Leaving work for the users to clean up isn't ideal, so it'd be better to use the go command to make modifications. Unfortunately, the go command has something of a mind of its own. The most obvious problem is that using go get to add a new require adds a // indirect comment to that new require, and there's no way to prevent it. The only thing we can do is add the require first, then use go get to do nothing but update the go.sum file. The other inherent problem is that the go command operates on files as they exist on disk, not the in-memory versions. As discussed, we issue an error for this case. The alternative would be to work on temporary files based on the in-memory contents, but that would be much larger change, so I'd rather not at least right now. To support Commands for quick fixes, add a new Command field to source.SuggestedFix, and use it when forming the CodeAction response. Fixes golang/go#38209. Change-Id: I0c13ea39199368623e7494e222ba38587323d417 Reviewed-on: https://go-review.googlesource.com/c/tools/+/265981 Trust: Heschi Kreinick <heschi@google.com> Run-TryBot: Heschi Kreinick <heschi@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org> |
||
|---|---|---|
| .. | ||
| acme.md | ||
| analyzers.md | ||
| atom.md | ||
| command-line.md | ||
| commands.md | ||
| contributing.md | ||
| daemon.md | ||
| design.md | ||
| emacs.md | ||
| faq.md | ||
| generate.go | ||
| generate_test.go | ||
| implementation.md | ||
| integrating.md | ||
| settings.md | ||
| status.md | ||
| subl.md | ||
| troubleshooting.md | ||
| user.md | ||
| vim.md | ||
| vscode.md | ||