package main
import (
"fmt"
"reflect"
)
func main() {
var Num float64 = 3.14
v := reflect.ValueOf(Num)
t := reflect.TypeOf(Num)
fmt.Println("Reflect : Num.Value = ", v)
fmt.Println("Reflect : Num.Type = ", t)
}
package main
import (
"fmt"
"reflect"
)
func main() {
var Num float64 = 3.14
v := reflect.ValueOf(Num)
t := reflect.TypeOf(Num)
fmt.Println("Reflect : Num.Value = ", v)
fmt.Println("Reflect : Num.Type = ", t)
}
本文标题:go 反射机制
本文链接:https://www.haomeiwen.com/subject/rbcwnktx.html
网友评论