-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathext.go
More file actions
21 lines (16 loc) · 837 Bytes
/
ext.go
File metadata and controls
21 lines (16 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package types
// AsArray is a type-assert like operation, x.(*Array), but never panics.
// Returns nil if type is not an array.
func AsArray(x Type) *Array { return nil }
// AsSlice is a type-assert like operation, x.(*Slice), but never panics.
// Returns nil if type is not an array.
func AsSlice(x Type) *Slice { return nil }
// AsPointer is a type-assert like operation, x.(*Pointer), but never panics.
// Returns nil if type is not a pointer.
func AsPointer(x Type) *Pointer { return nil }
// AsStruct is a type-assert like operation, x.(*Struct), but never panics.
// Returns nil if type is not a struct.
func AsStruct(x Type) *Struct { return nil }
// AsInterface is a type-assert like operation, x.(*Interface), but never panics.
// Returns nil if type is not an interface.
func AsInterface(x Type) *Interface { return nil }