golang 各种数据类型转换
golang 各种数据类型转换 Conversions are expressions of the form T(x) where T is a type and x is an expression that can be converted to type T. string > duration 1 2 d, e := time.ParseDuration("-1h") d, e := time.ParseDuration("1000ms") array > slice 1 2 arr := [3]int{1,2,3} sli := arr[:] hex > int, big.Int 1 2 3 4 5 6 // int n,