摘要: go get时由于防火墙的原因,会导致失败。目前可以通过修改GOPROXY的方法解决该问题。 无论是在win下还是linux,macos下,只需要将环境变量GOPROXY设置成https://goproxy.cn即可。可能还有别的代理可用。 有可能还需要设置GO111MODULE=on 具体在不同操 阅读全文
posted @ 2021-10-05 21:11 专职 阅读(1527) 评论(0) 推荐(0) 编辑
摘要: var price float32 = 39.29 float64和float32类似,只是用于表示各部分的位数不同而已,其中:sign=1位,exponent=11位,fraction=52位,也就意味着可表示的范围更大了。 二、decimal类型 由于golang中默认没有decimal类型,如 阅读全文
posted @ 2021-10-05 20:30 专职 阅读(1004) 评论(0) 推荐(0) 编辑
摘要: package main import ( "fmt" "math" ) func main() { fmt.Println(math.Abs(-19)) // 取绝对值 fmt.Println(math.Ceil(3.14)) // 向下取整 fmt.Println(math.Floor(3.14 阅读全文
posted @ 2021-10-05 15:05 专职 阅读(1020) 评论(0) 推荐(0) 编辑