]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.typealias] cmd/gofmt: added test cases for alias type declarations
authorRobert Griesemer <gri@golang.org>
Fri, 16 Dec 2016 23:56:05 +0000 (15:56 -0800)
committerRobert Griesemer <gri@golang.org>
Tue, 10 Jan 2017 00:09:48 +0000 (00:09 +0000)
For #18130.

Change-Id: I95e84130df40db5241e0cc25c36873c3281199ff
Reviewed-on: https://go-review.googlesource.com/34987
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/gofmt/testdata/typealias.golden [new file with mode: 0644]
src/cmd/gofmt/testdata/typealias.input [new file with mode: 0644]

diff --git a/src/cmd/gofmt/testdata/typealias.golden b/src/cmd/gofmt/testdata/typealias.golden
new file mode 100644 (file)
index 0000000..bbbbf32
--- /dev/null
@@ -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 (file)
index 0000000..6e49328
--- /dev/null
@@ -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
+)