package main import ( "fmt" ) const ( B float64 = 1 << (iota * 10) KB MB GB ) func main() { fmt.Println(B) fmt.Println(KB) fmt.Println(MB) fmt.Println(GB) }
1
1024
1.048576e+06
1.073741824e+09
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/16212.html