MCPcopy Create free account
hub / github.com/egonelbre/exp / TypesByString

Function TypesByString

sync2/runtime2/reflect2/type.go:11–24  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

9func typesByString(s string) []unsafe.Pointer
10
11func TypesByString(s string) []reflect.Type {
12 var types []reflect.Type
13 for _, t := range typesByString(s) {
14 pRtypeType := reflect.ValueOf(reflect.TypeOf(0)).Type()
15 rtype := reflect.New(pRtypeType).Elem()
16
17 ptr := unsafe.Pointer(reflect.ValueOf(rtype).FieldByName("ptr").Pointer())
18 *(*unsafe.Pointer)(ptr) = t
19
20 typ := rtype.Interface().(reflect.Type)
21 types = append(types, typ)
22 }
23 return types
24}

Callers 1

mainFunction · 0.92

Calls 2

typesByStringFunction · 0.85
TypeMethod · 0.80

Tested by

no test coverage detected