aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/gofmt
diff options
context:
space:
mode:
authorJoe Tsai <thebrokentoaster@gmail.com>2019-08-08 06:01:24 +0000
committerJoe Tsai <joetsai@google.com>2019-08-08 19:18:56 +0000
commitc5178ef69eedce1374e684212ea9cdae6220e0f6 (patch)
tree4494547ade3185d82e466f38ad9c65b03183477e /src/cmd/gofmt
parentfc23e216319f9e4338720dbd28e1cdedc0896b4d (diff)
downloadgo-c5178ef69eedce1374e684212ea9cdae6220e0f6.tar.gz
go-c5178ef69eedce1374e684212ea9cdae6220e0f6.zip
Revert "go/ast: fix SortImports to handle block comments"
This reverts CL 162337. Reason for revert: this introduces a regression Fixes #33538 Updates #18929 Change-Id: Ib2320a840c6d3ec7912e8f414e933d04fbf11ab4 Reviewed-on: https://go-review.googlesource.com/c/go/+/189379 Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/cmd/gofmt')
-rw-r--r--src/cmd/gofmt/testdata/import.golden60
-rw-r--r--src/cmd/gofmt/testdata/import.input62
2 files changed, 0 insertions, 122 deletions
diff --git a/src/cmd/gofmt/testdata/import.golden b/src/cmd/gofmt/testdata/import.golden
index f7d742e3e8..51d7be79df 100644
--- a/src/cmd/gofmt/testdata/import.golden
+++ b/src/cmd/gofmt/testdata/import.golden
@@ -1,4 +1,3 @@
-// package comment
package main
import (
@@ -21,10 +20,6 @@ import (
"io"
)
-// We reset the line numbering to test that
-// the formatting works independent of line directives
-//line :19
-
import (
"errors"
"fmt"
@@ -129,58 +124,3 @@ import (
"dedup_by_group"
)
-
-import (
- "fmt" // for Printf
- /* comment */ io1 "io"
- /* comment */ io2 "io"
- /* comment */ "log"
-)
-
-import (
- "fmt"
- /* comment */ io1 "io"
- /* comment */ io2 "io" // hello
- "math" /* right side */
- // end
-)
-
-import (
- "errors" // for New
- "fmt"
- /* comment */ io1 "io" /* before */ // after
- io2 "io" // another
- // end
-)
-
-import (
- "errors" // for New
- /* left */ "fmt" /* right */
- "log" // for Fatal
- /* left */ "math" /* right */
-)
-
-import /* why */ /* comment here? */ (
- /* comment */ "fmt"
- "math"
-)
-
-// Reset it again
-//line :100
-
-// Dedup with different import styles
-import (
- "path"
- . "path"
- _ "path"
- pathpkg "path"
-)
-
-/* comment */
-import (
- "fmt"
- "math" // for Abs
- // This is a new run
- "errors"
- "fmt"
-)
diff --git a/src/cmd/gofmt/testdata/import.input b/src/cmd/gofmt/testdata/import.input
index 6e3a3a3bed..9a4b09dbf9 100644
--- a/src/cmd/gofmt/testdata/import.input
+++ b/src/cmd/gofmt/testdata/import.input
@@ -1,4 +1,3 @@
-// package comment
package main
import (
@@ -21,10 +20,6 @@ import (
"io"
)
-// We reset the line numbering to test that
-// the formatting works independent of line directives
-//line :19
-
import (
"fmt"
"math"
@@ -134,60 +129,3 @@ import (
"dedup_by_group"
)
-
-import (
- /* comment */ io1 "io"
- "fmt" // for Printf
- /* comment */ "log"
- /* comment */ io2 "io"
-)
-
-import (
- /* comment */ io2 "io" // hello
- /* comment */ io1 "io"
- "math" /* right side */
- "fmt"
- // end
-)
-
-import (
- /* comment */ io1 "io" /* before */ // after
- "fmt"
- "errors" // for New
- io2 "io" // another
- // end
-)
-
-import (
- /* left */ "fmt" /* right */
- "errors" // for New
- /* left */ "math" /* right */
- "log" // for Fatal
-)
-
-import /* why */ /* comment here? */ (
- /* comment */ "fmt"
- "math"
-)
-
-// Reset it again
-//line :100
-
-// Dedup with different import styles
-import (
- "path"
- . "path"
- _ "path"
- "path"
- pathpkg "path"
-)
-
-/* comment */
-import (
- "math" // for Abs
- "fmt"
- // This is a new run
- "errors"
- "fmt"
- "errors"
-)