Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.0.0-20201105173854-bc9fc8d8c4bc / go / callgraph / rta / testdata / rtype.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.0.0-20201105173854-bc9fc8d8c4bc/go/callgraph/rta/testdata/rtype.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.0.0-20201105173854-bc9fc8d8c4bc/go/callgraph/rta/testdata/rtype.go
new file mode 100644 (file)
index 0000000..9e8f35d
--- /dev/null
@@ -0,0 +1,35 @@
+// +build ignore
+
+package main
+
+// Test of runtime types (types for which descriptors are needed).
+
+func use(interface{})
+
+type A byte // neither A nor byte are runtime types
+
+type B struct{ x uint } // B and uint are runtime types, but not the struct
+
+func main() {
+       var x int // not a runtime type
+       print(x)
+
+       var y string // runtime type due to interface conversion
+       use(y)
+
+       use(struct{ uint64 }{}) // struct is a runtime type
+
+       use(new(B)) // *B is a runtime type
+}
+
+// WANT:
+// Dynamic calls
+// Reachable functions
+//   use
+// Reflect types
+//   *B
+//   B
+//   string
+//   struct{uint64}
+//   uint
+//   uint64