详解 golang 中获取变量类型的3种方法

package main

import (
    "fmt"
    "reflect"
)
func main() {
    var num float64 = 3.14
 
    // 方法1:
    println(reflect.TypeOf(num).Name())
 
    // 方法2:
    fmt.Println(reflect.TypeOf(num))
 
    // 方法3:
    fmt.Println("%T",num)
}
微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_5880.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?