1
0
mirror of https://github.com/golang/go synced 2024-11-18 21:24:44 -07:00
go/internal/lsp/testdata/imports/remove_import.go.golden
Heschi Kreinick 8ceaad4c15 internal/lsp/source: don't format the whole file when adding imports
We want people to add imports as they need them. That means we probably
don't want adding an import to reformat your whole file while you're in
the middle of editing it.

Unfortunately, the AST package doesn't offer any help with this --
there's no good way to get a diff out of it. Instead, we apply the
changes, then diff a subset of the file. Picking that subset is tricky,
see the code for details.

Also delete a dead function, Imports, which should have been unused but
was still being called in tests.

Fixes golang/go#30843.

Change-Id: I09a5344e910f65510003c4006ea5b11657922315
Reviewed-on: https://go-review.googlesource.com/c/tools/+/205678
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-11-07 22:26:10 +00:00

12 lines
104 B
Plaintext

-- goimports --
package imports //@import("package")
import (
"fmt"
)
func _() {
fmt.Println("")
}