What's new in Go 1.12?

28 January 2019

Dmitri Shuralyov

Go team, Google

Time flies

Go 1.10 is already 11 months old!

Go 1.11 was released on August 24th, 2018.

On November 5th, 2018 we entered the release freeze for Go 1.12.

Go gopher by Renée French.
2

Go 1.12

Is Go 1.12 out yet?

import "golang.org/x/build/maintner/maintnerd/apipb"
// PrintGoReleases uses the provided maintner client
// to print the latest supported Go releases.
func PrintGoReleases(mc apipb.MaintnerServiceClient) error {
    resp, err := mc.ListGoReleases(context.Background(), &apipb.ListGoReleasesRequest{})
    if err != nil {
        return err
    }
    for _, r := range resp.Releases {
        fmt.Println(r.TagName)
    }
    return nil
}
3

Go 1.12

Is Go 1.12 out yet?

$ go run golang.org/x/build/maintner/maintq list-releases
major:1 minor:11 patch:5 tag_name:"go1.11.5" tag_commit:"35bb62e60a7779ff82c3067903b3306ff8666471" branch_name:"release-branch.go1.11" branch_commit:"f8e8303f566652fc74125e50a23eab612e8fc749"
major:1 minor:10 patch:8 tag_name:"go1.10.8" tag_commit:"b0cb374daf646454998bac7b393f3236a2ab6aca" branch_name:"release-branch.go1.10" branch_commit:"bd0449f8d16a5ac1b1962c7ea07d764a7f18eca7"
$
4

Go 1.12 Beta 2

Source: twitter.com/golang/status/1083529360798302210

5

Go 1.12 Beta 2

Source: twitter.com/bradfitz/status/1083558450129395712

6

Go release cycle

Source: golang.org/s/release

7

Go 1.12 release notes

Source: tip.golang.org/doc/go1.12

8

Agenda

Changes since Go 1.11:

Sources:

9

Changes to the language

10

Language

11

Language

12

Language

Things are happening:

13

Ports

14

Ports

New ports:

Reserved for future:

15

Ports

Improvements:

16

Ports

Last release to support:

17

Tooling

18

Tooling

go tool vet is no longer supported.

If you're currently doing:

go tool vet .

May replace with:

go vet ./...
19

Tooling

godoc and go doc:

$ godoc -help
usage: godoc
  ...
  -http string
        HTTP service address (default "localhost:6060")
  ...
$ go doc -help
Usage of [go] doc:
    go doc
    go doc <pkg>
    go doc <sym>[.<method>]
    go doc [<pkg>].<sym>[.<method>]
    go doc <pkg> <sym>[.<method>]
20

Tooling

Modules:

Only those that don't need current working directory or explicit go.mod editing. E.g., go get, go list, and go mod download behave as if in empty module. go env GOMOD reports system's null device (/dev/null).

The module cache (GOPATH/pkg/mod) must reside in a filesystem that supports file locking.

21

Tooling

Build cache requirement:

22

Tooling

Binary-only packages:

23

Tooling

Cgo:

24

Tooling

Compiler toolchain:

25

Runtime

26

Runtime

27

Runtime

28

Standard library

29

Standard library

Let's begin with the most visible change:

(A few moments later...)

30

TLS 1.3 (RFC 8446) support in crypto/tls

31

Standard library

Minor changes and updates with Go 1 promise of compatibility in mind:

32

Standard library

fmt

For example, fmt.Print ing this map:

map[uint8]string{7: "bar", 3: "foo"}

With Go 1.11:

map[7:bar 3:foo]
// or
map[3:foo 7:bar]

With Go 1.12:

map[3:foo 7:bar]
33

Standard library

os

34

Standard library

net/http/httputil

35

Standard library

net/http

36

Standard library

net

37

Standard library

io

// StringWriter is the interface that wraps the WriteString method.
type StringWriter interface {
    WriteString(s string) (n int, err error)
}
38

Standard library

reflect

39

Standard library

bytes, strings

40

Standard library

syscall/js

41

Standard library

crypto/rc4

42

Standard library

image

image/png

43

Standard library

time

44

Standard library

math

math/bits

45

Standard library

syscall

46

Standard library

testing

47

Standard library

Your favorite change missing here or in the Go 1.12 release notes?

Let me know!

48

Thank you

Use the left and right arrow keys or click the left and right edges of the page to navigate between slides.
(Press 'H' or navigate to hide this message.)