1
0
mirror of https://github.com/golang/go synced 2024-11-05 11:36:10 -07:00
go/imports
haya14busa 8524ce5143 imports, go/ast/astutil: do not make grouped imports non-grouped when removing
import (
		"fmt"
		"strings"
	)

When deleting "fmt" import statement, code should be converted to the
following code.

	import (
		"strings"
	)

Instead of

	import "strings"

Diff becomes nicer by this change and it avoids that rewriting grouped
imports non-grouped may result in confusion comments.

Example:

	// comment 1
	import (
		"fmt"
	        // comment 2
		"strings"
	)

should be

	// comment 1
	import (
	        // comment 2
		"strings"
	)

instead of

	// comment 1
        // comment 2
	import "strings"

Fixes golang/go#18051

Change-Id: I3c07b70b657191eacf83c3197a965e587286c950
Reviewed-on: https://go-review.googlesource.com/36853
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
2017-02-13 18:56:44 +00:00
..
fastwalk_dirent_fileno.go cmd/goimports, imports: optimize directory scanning and other things 2016-07-19 03:21:45 +00:00
fastwalk_dirent_ino.go imports: don't use fastpath on appengine (syscall not available) 2016-08-15 22:01:42 +00:00
fastwalk_portable.go imports: don't use fastpath on appengine (syscall not available) 2016-08-15 22:01:42 +00:00
fastwalk_test.go imports: fix formatting directive error found by go vet 2017-02-12 17:59:58 +00:00
fastwalk_unix.go imports: don't use fastpath on appengine (syscall not available) 2016-08-15 22:01:42 +00:00
fastwalk.go cmd/goimports, imports: optimize directory scanning and other things 2016-07-19 03:21:45 +00:00
fix_test.go imports, go/ast/astutil: do not make grouped imports non-grouped when removing 2017-02-13 18:56:44 +00:00
fix.go imports: respect ignoredDirs for symlinks 2016-11-23 02:24:47 +00:00
imports.go imports: remove unnecessary string conversion 2017-01-22 22:46:49 +00:00
mkindex.go go.tools/imports: move goimports from github to go.tools. 2013-12-17 21:21:03 -05:00
mkstdlib.go imports: update zstdlib to Go 1.7 2016-08-15 22:30:11 +00:00
sortimports.go imports: Remove ancient Go 1.1 compatibility indirections. 2015-12-14 00:47:31 +00:00
zstdlib.go imports: update zstdlib to Go 1.7 2016-08-15 22:30:11 +00:00