📜 ⬆️ ⬇️

Go 1.2 release

image December 1, 2013. We are pleased to announce the release of the latest stable version of Go 1.2.

Since the previous release of Go 1.1, in May, about seven months have passed and this is a much shorter period than fourteen months between releases 1.1 and 1.0. We expect comparable time intervals between major releases in the future.

Go 1.2 includes a couple of minor language changes, a number of improvements in the compiler implementation and tools, several points of performance improvement, many additions and (backward-compatible) changes to the standard library.
')
Please read the release notes in detail, as some changes may affect the behavior of existing programs. Next, we consider the main changes and innovations.

The new three-index slice syntax adds the ability to specify capacity (capacity) as well as length. This allows the programmer to transfer such a slice that has access to a limited part of the main array, a technique that previously required the use of the unsafe package.

The main new feature of the toolkit is a tool for calculating and displaying the results of code coverage tests . If you want to know the details, check out the go test documentation and the cover utility . Later this week we will publish an article in which we will consider a new feature in detail.

Now the dispatcher uses preemptive multitasking to execute gorutin and can be called from time to time when a gorutine enters a function. This allows you to periodically suspend the gorutiny that perform intensive calculations, and plan others that are in the same stream.

Increasing the default stack size for gorutin should improve the performance of some programs. (The old size tended to cause costly switching of a stack segment in critical performance areas.) On the other hand, new restrictions on stack sizes and the number of operating system threads should prevent the program from capturing all machine resources by incorrect programs. These limitations can be corrected using new functions from the runtime / debug package.

Finally, among the many changes in the standard library, significant changes include the new encoding package , the index arguments in the format strings for Printf functions, and some convenient additions to the template package.

As part of the release, the Go Playground has been updated to Go 1.2. This also affects the services that use the Playground, such as the Go Tour and the blog . Updates also add the ability to use os , net, and unsafe streams and packages in the sandbox, making it more like the actual Go environment.

For everyone who helped make this release possible, from many users who submitted bug reports, up to 116 contributors who made over 1600 changes to the core (!): Your help in the project is invaluable. Thank!

PS: On December 2, the Go blog published an article The cover story , which details the tool for determining the degree of code coverage of tests. The utility allows you to calculate the percentage of coverage of tests as a package as a whole, as well as a separate function, and even visually display uncovered places in the function. Along with the race detector and others, this tool is a good help for the developer.

Source: https://habr.com/ru/post/204632/


All Articles