Golang新版本 Go1.19新的fmt方法

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后缀默认换行。

在这里插入图片描述

2.unix构建

Support for the unix build constraint
GoLand now supports the new unix build tag, which recognizes any Unix or Unix-like system.

GoLand 现在支持新的unix构建标签,它可以识别任何 Unix 或类 Unix 系统。

3. 龙芯 loong64

Addition of loong64 to the Arch list
Go 1.19 is introducing a new architecture – loong64. We’ve added it to our Arch list in Settings | Go | Build Tags & Vendoring.

添加loong64到Arch列表
Go 1.19 引入了一种新的架构—— loong64. 我们已将其添加到设置 |中的Arch列表中 。go build 的标签可以选择龙芯 loong64


总结

Go(又称 Golang)是谷歌开发的一种静态强类型、编译型、并发型,并具有垃圾回收功能的编程语言,号称“21 世纪的 C 语言”,但是由于语言诞生时间较为短暂,部分功能参数、生态等等都有着不足,每一个版本自然也都很重要。

希望这个博客能对你有所益处。我是轻王,我为自己代言。

猜你喜欢

转载自blog.csdn.net/moer0/article/details/126475113