.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.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.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.go
new file mode 100644 (file)
index 0000000..463b4cb
--- /dev/null
@@ -0,0 +1,46 @@
+package a
+
+type Good struct {
+       y int32
+       x byte
+       z byte
+}
+
+type Bad struct { // want "struct of size 12 could be 8"
+       x byte
+       y int32
+       z byte
+}
+
+type ZeroGood struct {
+       a [0]byte
+       b uint32
+}
+
+type ZeroBad struct { // want "struct of size 8 could be 4"
+       a uint32
+       b [0]byte
+}
+
+type NoNameGood struct {
+       Good
+       y int32
+       x byte
+       z byte
+}
+
+type NoNameBad struct { // want "struct of size 20 could be 16"
+       Good
+       x byte
+       y int32
+       z byte
+}
+
+type WithComments struct { // want "struct of size 8 could be 4"
+       // doc style comment
+       a uint32  // field a comment
+       b [0]byte // field b comment
+       // other doc style comment
+
+       // and a last comment
+}