This is a creation in Article, where the information may have evolved or changed.
Google's go language will improve performance, compile and scale large code libraries in the next release. Go 1.9 should be released in August.
The creators of Go 1.9 want almost all go programs to run as before, and their focus remains compatibility in the latest version.
Here are the new features and improvements:
The
- garbage collector accelerates, generating better code and core library optimizations should make the program run faster;
- math/bits package, which is a new package that optimizes the operation of bits. The functions in the package are treated by the compiler as inline functions to improve performance; the
- Go 1.9 compiler supports functions in a parallel compilation package, leveraging multiple processor cores. Go 1.9 retains the previous version of the GO command to support the parallel compilation of individual packages. By default, parallel compilation is turned on, but can be disabled.
- for extensibility, Go 1.9 adds support for type aliases for code repair. Changes to the Go language, type aliases support progressive repair of code, and support for moving types between packages. It should be a secondary code fix during a large-scale refactoring, which will refer to the type in the package instead of the type that references the new package, and the two types are consistent. Basically, the introduction of class aliases provides a transition period in which APIs can be obtained from new and old packages, and references to old and new versions can exist at the same time. The
- Go 1.9 Increases the transparent monotonically increasing time (transparent monotonic times) support, which makes the calculation duration between two time values always secure, even in the case of clock adjustments. RELATED Links: Package docs, design document
- Go 1.9 Improved testing capabilities, new (T). Helper and (B). The helper method marks the calling function as a test helper function. When you print the file and line information, the function is skipped. This allows writing the test helper function while still providing the user with a useful line number. The new map type in the
- Sync Pack has a concurrent map with amortization-constant time loading, storage, and deletion. Multiple goroutines can call it safely and concurrently.
For more information, read the Go1.9 properties document