MCPcopy
hub / github.com/duke-git/lancet / ExampleToInterface

Function ExampleToInterface

convertor/convertor_example_test.go:397–409  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

395}
396
397func ExampleToInterface() {
398 val := reflect.ValueOf("abc")
399 iVal, ok := ToInterface(val)
400
401 fmt.Printf("%T\n", iVal)
402 fmt.Printf("%v\n", iVal)
403 fmt.Println(ok)
404
405 // Output:
406 // string
407 // abc
408 // true
409}
410
411func ExampleUtf8ToGbk() {
412 utf8Data := []byte("hello")

Callers

nothing calls this directly

Calls 2

ToInterfaceFunction · 0.85
ValueOfMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…