$30 off During Our Annual Pro Sale. View Details »

The State of Go: Feb 2019

The State of Go: Feb 2019

Go 1.12 is planned to be released in February 2019 and this talk covers what's coming up with it.

We'll talk about Go Modules, the proposals for Go 2, and all of the new things you might have missed.

This has been a staple talk of the Go devroom, opening the stage every year, and has always been a successful one.

Francesc Campoy Flores

February 02, 2019
Tweet

More Decks by Francesc Campoy Flores

Other Decks in Programming

Transcript

  1. THE STATE
    OF GO
    What's new since Go 1.10

    View Slide

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

    View Slide

  3. 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

    View Slide

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

    View Slide

  5. CHANGES TO
    THE LANGUAGE

    View Slide

  6. This page is intentionally left void

    View Slide

  7. CHANGES TO THE
    STANDARD
    LIBRARY

    View Slide

  8. Breaking Changes

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  12. Before: nothing
    Now: bufio: invalid use of UnreadByte

    View Slide

  13. Other Interesting Changes

    View Slide

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

    View Slide

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

    View Slide

  16. 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

    View Slide

  17. printing a map in order before

    View Slide

  18. 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

    View Slide

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

    View Slide

  20. 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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  24. TOOLING

    View Slide

  25. go run pkg now works!
    Go 1.11

    View Slide

  26. go run dir now works!
    Go 1.11

    View Slide

  27. debugger can now run functions
    Go 1.11

    View Slide

  28. ▪ 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

    View Slide

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

    View Slide

  30. godoc
    32
    ▪ godoc now show version that introduced stuff

    View Slide

  31. “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

    View Slide

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

    View Slide

  33. 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

    View Slide

  34. modules
    Go 1.11
    justforfunc.com

    View Slide

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

    View Slide

  36. RUNTIME

    View Slide

  37. Couldn’t find anything for 1.12
    PERFORMANCE

    View Slide

  38. 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

    View Slide

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

    View Slide

  40. COMMUNITY

    View Slide

  41. Back in 2014 (five years ago!)

    View Slide

  42. Last year ...

    View Slide

  43. This year ...

    View Slide

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

    View Slide

  45. GO MEETUPS IN THE WORLD

    View Slide

  46. 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

    View Slide

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

    View Slide