, 20 tweets, 8 min read Read on Twitter
Go 1.13 is definitely the best Go version ever! You'll have to trust me this time, as @bradfitz was on leave 😉

Here's a thread of highlights from the release ✨💥

There were more than 1750 commits since Go 1.12, so I'm going to miss some awesomeness here. Of course, I can't claim credit for almost any of this.

All user-visible changes are in the release notes 👇

golang.org/doc/go1.13
First the headliners: Go 2 language changes!

New number literals and signed shift counts.
No more ugly "x << uint(n)".

golang.org/design/19308-n…
golang.org/design/19113-s…
Remember that Go 2 changes are going to come in the form of minimally disruptive proposals.

Language changes are module scoped and gated on the language version in the go.mod, so each module can update on its own schedule.

blog.golang.org/go2-next-steps
Modules! 🧩 A million modules improvements. Such a smoother experience on Go 1.13.

· GO111MODULE=auto is on whenever a go.mod is found (even in GOPATH/src)
· +incompatible and pseudo-versions are now checked for validity (yay robustness)
· The Module Mirror and Checksum Database! Too much to say about this. Read the blog post (blog.golang.org/module-mirror-…), skim the proposal (golang.org/design/25530-s…) and watch @katie_hockman's fantastic talk

@katie_hockman · "go get -u" now updates a smaller set of modules, similar to GOPATH mode (tip: you usually want to run "go get example.com/foo" or "go get -u all")
As well as more go tool improvements!

· "go env -w" sets environment variables, stored at os.UserConfigDir()/go/env
· "go build -trimpath" for more reproducible builds
· "go build -o dir" supports building multiple binaries
· "go version [-m] binary.exe" prints Go/module version
Next, ✨ CRYPTOGRAPHY 💥

TLS 1.3 on by default! (And SSLv3 is deprecated.)

Use GODEBUG=tls13=off to opt-out and report issues!
There's more Ed25519 all around, the modern asymmetric signature scheme. crypto/ed25519 is now in the standard library, and Ed25519 certificates work in crypto/{x509,tls}.

golang.org/pkg/crypto/ed2…
Finally, in support of my crusade against assembly, the important math/bits intrinsics are now guaranteed to be constant time. golang.org/issue/31267

This will enable secure, reasonably fast, readable Go implementations like my Poly1305. blog.filippo.io/a-literate-go-…
Package errors now has native support for wrapping.

An error can wrap another by returning it from an "Unwrap() error" method.

golang.org/doc/go1.13#err…
The easiest way to wrap errors is by using the new "%w" fmt.Errorf verb.

fmt.Errorf("failed to send tweet: %w", err)
Is() is the recursive version of equality.
As() is the recursive version of a type assertion.
And more, and more. Quick highlights from the rest of the stdlib.

· New escape analysis engine! golang.org/issue/23109

· Keep-alives on by default server-side. (Configure or disable with ListenConfig.KeepAlive.)

· Testing multiple packages prints a summary at the end.
· Custom benchmark metrics with B.ReportMetric.

· defer is up to 30% faster. github.com/golang/go/comm…

· Mutex.Lock, Mutex.Unlock, RWMutex.Lock, RWMutex.RUnlock, and Once.Do fast paths are inlined.

· json.Decoder is 15-20% faster. github.com/golang/go/issu…
(oss-fuzz is also now running some standard library fuzzers, and found a bug in the new json Decoder that we got to fix before the release! bugs.chromium.org/p/oss-fuzz/iss…)
Out of bounds panics are better.

Before: runtime error: index out of range
After: runtime error: index out of range [3] with length 1
And finally, my favorite little thing.

sync.Pool does not cause allocations at all in steady state.

Every GC instead of draining the pool, the contents are set aside to be collected at the next round. If they are reused before that, no allocations! github.com/golang/go/comm…
Missing some Tweet in this thread?
You can try to force a refresh.

Like this thread? Get email updates or save it to PDF!

Subscribe to Filippo Valsorda
Profile picture

Get real-time email alerts when new unrolls are available from this author!

This content may be removed anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!