aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/gofmt
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2016-12-16 15:56:05 -0800
committerRobert Griesemer <gri@golang.org>2017-01-10 00:09:48 +0000
commite0a05c274aa5a3917c5e53f72537e38bb05c10d6 (patch)
treecac3293f1fc486ff4a67c69219e642554e98ae58 /src/cmd/gofmt
parent2e5116bd999be18691d860e47cb87f1446cf70fe (diff)
downloadgo-e0a05c274aa5a3917c5e53f72537e38bb05c10d6.tar.gz
go-e0a05c274aa5a3917c5e53f72537e38bb05c10d6.zip
[dev.typealias] cmd/gofmt: added test cases for alias type declarations
For #18130. Change-Id: I95e84130df40db5241e0cc25c36873c3281199ff Reviewed-on: https://go-review.googlesource.com/34987 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/gofmt')
-rw-r--r--src/cmd/gofmt/testdata/typealias.golden24
-rw-r--r--src/cmd/gofmt/testdata/typealias.input24
2 files changed, 48 insertions, 0 deletions
diff --git a/src/cmd/gofmt/testdata/typealias.golden b/src/cmd/gofmt/testdata/typealias.golden
new file mode 100644
index 0000000000..bbbbf32121
--- /dev/null
+++ b/src/cmd/gofmt/testdata/typealias.golden
@@ -0,0 +1,24 @@
+package q
+
+import "p"
+
+type _ = int
+type a = struct{ x int }
+type b = p.B
+
+type (
+ _ = chan<- int
+ aa = interface{}
+ bb = p.BB
+)
+
+// TODO(gri) We may want to put the '=' into a separate column if
+// we have mixed (regular and alias) type declarations in a group.
+type (
+ _ chan<- int
+ _ = chan<- int
+ aa0 interface{}
+ aaa = interface{}
+ bb0 p.BB
+ bbb = p.BB
+)
diff --git a/src/cmd/gofmt/testdata/typealias.input b/src/cmd/gofmt/testdata/typealias.input
new file mode 100644
index 0000000000..6e49328e34
--- /dev/null
+++ b/src/cmd/gofmt/testdata/typealias.input
@@ -0,0 +1,24 @@
+package q
+
+import "p"
+
+type _ = int
+type a = struct{ x int }
+type b = p.B
+
+type (
+ _ = chan<- int
+ aa = interface{}
+ bb = p.BB
+)
+
+// TODO(gri) We may want to put the '=' into a separate column if
+// we have mixed (regular and alias) type declarations in a group.
+type (
+ _ chan<- int
+ _ = chan<- int
+ aa0 interface{}
+ aaa = interface{}
+ bb0 p.BB
+ bbb = p.BB
+)