Table of Content
Go 1.17 is released
The 16 of August 2021, the Go Team releases the version 1.17 of Go
This release brings additional improvements to the compiler, namely a new way of passing function arguments and results. This change has shown about a 5% performance improvement in Go programs and reduction in binary sizes of around 2% for amd64 platforms. Support for more platforms will come in future releases.
Go 1.17 also adds support for the 64-bit ARM architecture on Windows, letting gophers run Go natively on more devices.
What are the changes of this version?
Most of its changes are in the implementation of the toolchain, runtime, and libraries
Changes to the language
Go 1.17 includes three small enhancements to the language.
- Conversions from slice to array pointer: An expression s of type
[]
may now be converted to array pointer type*[N]T
. If a is the result of such a conversion, then corresponding indices that are in range refer to the same underlying elements:&a[i] == &s[i]
for $0 <= i < N$. The conversion panics iflen(s)
is less than $N$. unsafe.Add
:unsafe.Add(ptr, len)
addslen
toptr
and returns the updated pointerunsafe.Pointer(uintptr(ptr) + uintptr(len))
.unsafe.Slice
: For expression ptr of type*T, unsafe.Slice(ptr, len)
returns a slice of type[]T
whose underlying array starts atptr
and whose length and capacity arelen
.
Other minor changes
- It will require macOS 10.13 High Sierra or later
- 64-bit ARM architecture on Windows is now supported, including CGO support.
- The 64-bit MIPS architecture on OpenBSD (the openbsd/mips64 port) now supports cgo.
- Go programs now maintain stack frame pointers on the 64-bit ARM architecture on all operating systems
- loong64 GOARCH value reserved for future implementations.
- Pruned module graphs in go 1.17 modules
|
|
|
|
- Module deprecation comments. Module authors may deprecate a module by adding a
// Deprecated:
comment to go.mod - The go command by default now suppresses SSH password prompts and Git Credential Manager prompts when fetching Git repositories using SSH, as it already did previously for other Git password prompts.
- The go command now understands
//go:build
lines and prefers them over// +build lines
. The new syntax uses boolean expressions, just like Go, and should be less error-prone. - gofmt (and go fmt) now synchronizes
//go:build
lines with// +build lines
. If a file only has// +build lines
, they will be moved to the appropriate location in the file, and matching//go:build
lines will be added. - Go vet has a new warning for calling
signal.Notify
on unbuffered channels.
|
|
Users of signal.Notify
should use channels with sufficient buffer space to keep up with the expected signal rate.
- New warnings for Is, As and Unwrap methods
- The cover tool now uses an optimized parser from
golang.org/x/tools/cover
, which may be noticeably faster when parsing large coverage profiles. - The
runtime/cgo
package now provides a new facility that allows to turn any Go values to a safe representation that can be used to pass values between C and Go safely. See runtime/cgo.Handle for detailed information.
|
|
and on the C side:
|
|
- The
crypto/ed25519
package has been rewritten, and all operations are now approximately twice as fast onamd64
andarm64
. The observable behavior has not otherwise changed. CurveParams
methods now automatically invoke faster and safer dedicated implementations for known curves (P-224
,P-256
, andP-521
) when available. Note that this is a best-effort approach and applications should avoid using the generic, not constant-timeCurveParams
methods and instead use dedicated Curve implementations such asP256
. TheP521
curve implementation has been rewritten using code generated by the fiat-crypto project, which is based on a formally-verified model of the arithmetic operations. It is now constant-time and three times faster onamd64
andarm64
. The observable behavior has not otherwise changed.- The
crypto/rand
package now uses thegetentropy
syscall on macOS and thegetrandom
syscall on Solaris, Illumos, and DragonFlyBSD. binary.Uvarint
will stop reading after 10 bytes to avoid wasted computations. If more than 10 bytes are needed, the byte count returned is -11.- The math package now defines three more constants:
MaxUint
,MaxInt
andMinInt
. For 32-bit systems their values are $2^{32} - 1$, $2^{31} - 1$ and $-2^{31}$, respectively. For 64-bit systems their values are $2^{64} - 1$, $2^{63} - 1$ and $-2^{63}$, respectively. - Regarding to pprof, block profiles are no longer biased to favor infrequent long events over frequent short events.
- The strconv package now uses Ulf Adams’s Ryū algorithm for formatting floating-point numbers. This algorithm improves performance on most inputs and is more than 99% faster on worst-case inputs.
atomic.Value
now hasSwap
andCompareAndSwap
methods that provide additional atomic operations.
You can check all changelog information at https://golang.org/doc/go1.17#language
Subscribe, donate or become premium
💬 Share this post in social media
Thanks for checking this out and I hope you found the info useful! If you have any questions, don't hesitate to write me a comment below. And remember that if you like to see more content on, just let me know it and share this post with your colleges, co-workers, FFF, etc.