diff options
author | Matthew Dempsky <mdempsky@google.com> | 2021-07-28 13:39:30 -0700 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2021-07-28 21:40:40 +0000 |
commit | 53557530093938e19c21f6b02a482939ac6e634b (patch) | |
tree | 18d51aa04629aaad621399e997306118b36a5952 /test/typeparam/pairimp.dir | |
parent | 473e493d18c277d69e40a4930af045d474ff2be4 (diff) | |
download | go-53557530093938e19c21f6b02a482939ac6e634b.tar.gz go-53557530093938e19c21f6b02a482939ac6e634b.zip |
[dev.typeparams] test/typeparam: gofmt -w
We don't usually reformat the test directory, but all of the files in
test/typeparam are syntactically valid. I suspect the misformattings
here are because developers aren't re-installing gofmt with
-tags=typeparams, not intentionally exercising non-standard
formatting.
Change-Id: I3767d480434c19225568f3c7d656dc8589197183
Reviewed-on: https://go-review.googlesource.com/c/go/+/338093
Trust: Matthew Dempsky <mdempsky@google.com>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'test/typeparam/pairimp.dir')
-rw-r--r-- | test/typeparam/pairimp.dir/a.go | 4 | ||||
-rw-r--r-- | test/typeparam/pairimp.dir/main.go | 27 |
2 files changed, 17 insertions, 14 deletions
diff --git a/test/typeparam/pairimp.dir/a.go b/test/typeparam/pairimp.dir/a.go index 27b2412961..a984fba37b 100644 --- a/test/typeparam/pairimp.dir/a.go +++ b/test/typeparam/pairimp.dir/a.go @@ -5,6 +5,6 @@ package a type Pair[F1, F2 any] struct { - Field1 F1 - Field2 F2 + Field1 F1 + Field2 F2 } diff --git a/test/typeparam/pairimp.dir/main.go b/test/typeparam/pairimp.dir/main.go index fc2face81d..027fdd9ce7 100644 --- a/test/typeparam/pairimp.dir/main.go +++ b/test/typeparam/pairimp.dir/main.go @@ -11,17 +11,20 @@ import ( ) func main() { - p := a.Pair[int32, int64]{1, 2} - if got, want := unsafe.Sizeof(p.Field1), uintptr(4); got != want { - panic(fmt.Sprintf("unexpected f1 size == %d, want %d", got, want)) - } - if got, want := unsafe.Sizeof(p.Field2), uintptr(8); got != want { - panic(fmt.Sprintf("unexpected f2 size == %d, want %d", got, want)) - } + p := a.Pair[int32, int64]{1, 2} + if got, want := unsafe.Sizeof(p.Field1), uintptr(4); got != want { + panic(fmt.Sprintf("unexpected f1 size == %d, want %d", got, want)) + } + if got, want := unsafe.Sizeof(p.Field2), uintptr(8); got != want { + panic(fmt.Sprintf("unexpected f2 size == %d, want %d", got, want)) + } - type mypair struct { Field1 int32; Field2 int64 } - mp := mypair(p) - if mp.Field1 != 1 || mp.Field2 != 2 { - panic(fmt.Sprintf("mp == %#v, want %#v", mp, mypair{1, 2})) - } + type mypair struct { + Field1 int32 + Field2 int64 + } + mp := mypair(p) + if mp.Field1 != 1 || mp.Field2 != 2 { + panic(fmt.Sprintf("mp == %#v, want %#v", mp, mypair{1, 2})) + } } |