File tree 2 files changed +17
-0
lines changed 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ func AsSlice(x Type) *Slice { return nil }
12
12
// Returns nil if type is not a pointer.
13
13
func AsPointer (x Type ) * Pointer { return nil }
14
14
15
+ // AsStruct is a type-assert like operation, x.(*Struct), but never panics.
16
+ // Returns nil if type is not a struct.
17
+ func AsStruct (x Type ) * Struct { return nil }
18
+
15
19
// AsInterface is a type-assert like operation, x.(*Interface), but never panics.
16
20
// Returns nil if type is not an interface.
17
21
func AsInterface (x Type ) * Interface { return nil }
Original file line number Diff line number Diff line change 29
29
30
30
// An Interface represents an interface type.
31
31
Interface struct {}
32
+
33
+ // A struct represents a struct type.
34
+ Struct struct {}
32
35
)
33
36
34
37
// NewArray returns a new array type for the given element type and length.
@@ -53,3 +56,13 @@ func NewPointer(elem Type) *Pointer { return nil }
53
56
54
57
// Elem returns the element type for the given pointer.
55
58
func (* Pointer ) Elem () Type { return nil }
59
+
60
+ func (* Struct ) NumFields () int { return 0 }
61
+
62
+ func (* Struct ) Field (i int ) * Var { return nil }
63
+
64
+ type Var struct {}
65
+
66
+ func (* Var ) Embedded () bool { return false }
67
+
68
+ func (* Var ) Type () Type { return nil }
You can’t perform that action at this time.
0 commit comments