Slide 1

Slide 1 text

THE STATE OF GO What's new since Go 1.10

Slide 2

Slide 2 text

bit.ly/sog-fosdem19 Maartje Eyskens @maartjeme Francesc Campoy @francesc

Slide 3

Slide 3 text

What's new since Go 1.10 ▪ Go 1.11 ▫ Released August 24th 2018 ▪ Go 1.12 ▫ Released … eventually ▫ Go 1.12 beta2 released on January 10th 2019

Slide 4

Slide 4 text

Agenda Changes to: ● the language ● the standard library ● the tooling ● the community

Slide 5

Slide 5 text

CHANGES TO THE LANGUAGE

Slide 6

Slide 6 text

This page is intentionally left void

Slide 7

Slide 7 text

CHANGES TO THE STANDARD LIBRARY

Slide 8

Slide 8 text

Breaking Changes

Slide 9

Slide 9 text

Changed behavior when typed interface to an implicit escaper function. Previously . Now ignored. html/template 11 Go 1.11

Slide 10

Slide 10 text

Before: <nil> Now: nothing* * or not 12

Slide 11

Slide 11 text

Reader's UnreadRune and UnreadByte methods will now return an error if they are called after Peek. bufio 13 Go 1.12

Slide 12

Slide 12 text

Before: nothing Now: bufio: invalid use of UnreadByte

Slide 13

Slide 13 text

Other Interesting Changes

Slide 14

Slide 14 text

templating: assignment Previously, only variable declaration was possible. Now, assignment is also supported! Go 1.11

Slide 15

Slide 15 text

x.Replace(s, a, b, -1) → x.ReplaceAll(s, a, b) where x can be: ▪ bytes ▪ strings new ReplaceAll functions Go 1.12

Slide 16

Slide 16 text

builtin: maps printed sorted Previously, in order to print a map sorted by keys: 1. Iterate over all the keys 2. Sort them (somehow) 3. Iterate over the sorted keys 4. Print key and value Go 1.12

Slide 17

Slide 17 text

printing a map in order before

Slide 18

Slide 18 text

Now, in order to print a map sorted by keys: 1. Print the map WARNING: iteration order is still random. builtin: maps are now printed sorted

Slide 19

Slide 19 text

TLS 1.3 support ▪ Cipher suites are not configurable (yet?) ▪ 0-RTT not supported ▪ Only if set: Go 1.12

Slide 20

Slide 20 text

why TLS 1.3? Without 0-RTT ▪ 1 fewer round trip ▪ Only secure cipher suites* ▪ Support in all major browsers * in January 2019 Go 1.12

Slide 21

Slide 21 text

why TLS 1.3? TLS1.2 Without 0-RTT Source: Wikipedia

Slide 22

Slide 22 text

why TLS 1.3? Without 0-RTT Source: Wikipedia Go 1.12

Slide 23

Slide 23 text

reverse proxy + websockets The code below now supports websockets! Go 1.12

Slide 24

Slide 24 text

TOOLING

Slide 25

Slide 25 text

go run pkg now works! Go 1.11

Slide 26

Slide 26 text

go run dir now works! Go 1.11

Slide 27

Slide 27 text

debugger can now run functions Go 1.11

Slide 28

Slide 28 text

▪ Delve v1.1.0 only ▪ No new variables ▪ All goroutines will continue ▪ Only when stopped at a safe point ▪ Only on Linux (MacOS too) debugger can now run functions Go 1.11

Slide 29

Slide 29 text

godoc ▪ godoc CLI is deprecated ▪ Use go doc ▪ In1.12 feature complete with -all flag 31

Slide 30

Slide 30 text

godoc 32 ▪ godoc now show version that introduced stuff

Slide 31

Slide 31 text

“For the addition of features in later point releases, it may be necessary to add fields to exported structs in the API. Go 1 and the Future of Go Programs 33

Slide 32

Slide 32 text

▪ go tool vet is deprecated ▪ Detects wrapped fmt.Printf errors go vet 34 Go 1.11 Go 1.12

Slide 33

Slide 33 text

modules ▪ an alternative to GOPATH ▪ integrated versioning and package distribution ▪ details are likely to change ▪ Binary only packages not supported after 1.12 ▪ No more @ in import path ▪ golang.org/x/tools/go/packages Go 1.11

Slide 34

Slide 34 text

modules Go 1.11 justforfunc.com

Slide 35

Slide 35 text

Add custom events to runtime traces. Documentation: golang.org/pkg/runtime/trace More: bit.ly/go-udtrace runtime/trace: user annotations Go 1.11

Slide 36

Slide 36 text

RUNTIME

Slide 37

Slide 37 text

Couldn’t find anything for 1.12 PERFORMANCE

Slide 38

Slide 38 text

PORTS ▪ Go 1.11 OpenBSD 6.2 or later ▪ OpenBSD 6.4 only works on Go 1.11 and later ▪ Go 1.13 on macOS will require 10.11 or later ▪ Go 1.12 last release supported on FreeBSD 10.x ▪ Runtime: arm64 now faster ▪ windows/arm supports Raspberry Pi3 ▪ RISC-V and GNU/HURD are reserved values

Slide 39

Slide 39 text

▪ Go can now compile to Web Assembly (wasm) More: github.com/golang/go/wiki/WebAssembly web assembly Go 1.11

Slide 40

Slide 40 text

COMMUNITY

Slide 41

Slide 41 text

Back in 2014 (five years ago!)

Slide 42

Slide 42 text

Last year ...

Slide 43

Slide 43 text

This year ...

Slide 44

Slide 44 text

WOMEN WHO GO & GOBRIDGE MEETUPS 46 6 more than 2018: 30 chapters now!

Slide 45

Slide 45 text

GO MEETUPS IN THE WORLD

Slide 46

Slide 46 text

conferences ▪ Go Devroom @ FOSDEM 2019 (you are here) ▪ dotGo: Paris, March 25 ▪ GothamGo: NYC, April 12 ▪ GopherCon Singapore, April 24-26 ▪ GopherCon EU: Tenerife, May 30-June 1 ▪ GoCon Canada: Toronto, May 31 ▪ GopherCon: San Diego, July 24-27

Slide 47

Slide 47 text

THANKS! Francesc and (voiceless) Maartje 54 Gophers by Renee French, Ashley McNamara, Egon Elbre, Sam Croswell and Miguel Molina