1.18版的两个新教程

Two New Tutorials for 1.18 - 1.18版的两个新教程

https://go.dev/blog/tutorials-go1.18

Katie Hockman, for the Go team 14 January 2022

We will be releasing Go 1.18 soon, and this release includes a few new concepts for Go. We have published two new tutorials to help introduce you to these upcoming features.

我们将很快发布Go 1.18,这个版本包括了Go的一些新概念。我们发布了两个新的教程来帮助您介绍这些即将到来的功能。

The first new tutorial will help you get started with generics. This tutorial walks you through creating a generic function that can handle multiple types, and calling it from your code. Once you’ve created a generic function, you’ll learn about type constraints, and write some for your function. Also consider checking out the GopherCon talk about generics to learn more.

第一个新教程将帮助您开始使用泛型。本教程将指导您创建一个可以处理多种类型的泛型函数,并从您的代码中调用它。一旦您创建了一个泛型函数,您将了解类型约束,并为您的函数编写一些约束。也可以考虑看看GopherCon关于泛型的讲座,以了解更多。

The second new tutorial will help you get started with fuzzing. This tutorial demonstrates how fuzzing can find bugs in your code, and walks through the process of diagnosing and fixing the issues. In this tutorial, you will write code that has a few bugs and use fuzzing to find, fix, and verify the bugs using the go command. Special thanks to Beth Brown for her work on the fuzzing tutorial!

第二个新教程将帮助您开始进行模糊处理。本教程演示了模糊分析如何在您的代码中发现错误,并介绍了诊断和修复问题的过程。在本教程中,您将编写有一些bug的代码,并使用fuzzing来寻找、修复和验证使用go命令的bug。特别感谢Beth Brown在模糊处理教程中的工作!

Go 1.18 Beta 1 was released last month, which you can get by visiting the downloads page.

Go 1.18 Beta 1已于上个月发布,您可以通过访问下载页面获得。

See the full draft release notes for Go 1.18 for more details about what to expect in the release.

请参阅Go 1.18的完整发布说明草案,以了解更多有关该版本的细节。

As always, if you notice any problems, please file an issue.

像往常一样,如果您发现任何问题,请提交问题。

We hope you enjoy the tutorials, and we look forward to everything to come in 2022!

我们希望您喜欢这些教程,并期待着2022年的一切!