Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions safe_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import (
)

type safeType struct {
reflect.Type
cfg *frozenConfig
Type reflect.Type
cfg *frozenConfig
}

var _ Type = &safeType{}

func (type2 *safeType) New() interface{} {
return reflect.New(type2.Type).Interface()
}
Expand All @@ -18,6 +20,22 @@ func (type2 *safeType) UnsafeNew() unsafe.Pointer {
panic("does not support unsafe operation")
}

func (type2 *safeType) Kind() reflect.Kind {
return type2.Type.Kind()
}

func (type2 *safeType) Len() int {
return type2.Type.Len()
}

func (type2 *safeType) NumField() int {
return type2.Type.NumField()
}

func (type2 *safeType) String() string {
return type2.Type.String()
}

func (type2 *safeType) Elem() Type {
return type2.cfg.Type2(type2.Type.Elem())
}
Expand Down