Golang新版本 Go1.19新的fmt方法
Golang轻松学习一、Go1.19?
相对于Go 1.18泛型的加入,Go 1.19的确算是一个“小版本”,只修改了一部分编译支持的参数与格式化的函数。
二、新版本区别
1.fmt.Appendf
Support for fmt.Appendf
We’ve added support for fmt.Appendf, and now GoLand identifies formatting verbs inside strings. As a result, the Appendf function benefits from all of the features that formatting functions have, such as the Add a format string argument intention action.
我们添加了对切片数组支持 fmt.Appendf,现在 GoLand 可以识别字符串中的格式化动词。因此,该Appendf函数受益于格式化函数所具有的所有功能,例如添加格式字符串参数意图操作。
同时也支持 fmt.Append,fmt.Appendln,返回与 fmt.Appendf都是切片数组
区别与fmt.Print fmt.Printf fmt.Println之间大同小异,f后缀支持格式化函数,ln后缀默