mirror of
https://github.com/golang/go
synced 2024-11-19 13:14:42 -07:00
8ceaad4c15
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>
11 lines
109 B
Go
11 lines
109 B
Go
package imports //@import("package")
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
func _() {
|
|
fmt.Println("")
|
|
bytes.NewBuffer(nil)
|
|
}
|