.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.1.1-0.20210319172145-bda8f5cee399 / go / analysis / passes / fieldalignment / testdata / src / a / a_386.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.1.1-0.20210319172145-bda8f5cee399/go/analysis/passes/fieldalignment/testdata/src/a/a_386.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.1.1-0.20210319172145-bda8f5cee399/go/analysis/passes/fieldalignment/testdata/src/a/a_386.go
new file mode 100644 (file)
index 0000000..13f9b9f
--- /dev/null
@@ -0,0 +1,40 @@
+package a
+
+type PointerGood struct {
+       P   *int
+       buf [1000]uintptr
+}
+
+type PointerBad struct { // want "struct with 4004 pointer bytes could be 4"
+       buf [1000]uintptr
+       P   *int
+}
+
+type PointerSorta struct {
+       a struct {
+               p *int
+               q uintptr
+       }
+       b struct {
+               p *int
+               q [2]uintptr
+       }
+}
+
+type PointerSortaBad struct { // want "struct with 16 pointer bytes could be 12"
+       a struct {
+               p *int
+               q [2]uintptr
+       }
+       b struct {
+               p *int
+               q uintptr
+       }
+}
+
+type MultiField struct { // want "struct of size 20 could be 12"
+       b      bool
+       i1, i2 int
+       a3     [3]bool
+       _      [0]func()
+}