for octal literal fmt.Println(0o10, 0O10, 010) // 8 8 8 • All number formats can now be imaginary fmt.Println(0b111i) // (0+7i) New number literals 7 Go 1.13
int64(2) fmt.Println(1 << s) // 8 • But the following program will panic s := int64(-2) fmt.Println(1 << s) // panic: runtime error: negative shift amount New number literals 9 Go 1.13
0) // 1000 strconv.ParseInt("0b1_000", 0, 0) // 8 strconv.ParseInt("0o1_000", 0, 0) // 512 strconv.ParseInt("0x1_000", 0, 0) // 4096 Otherwise, it will fail the same way it would fail with explicit base. strconv.ParseInt("0b1_000", 2, 0) // invalid syntax strconv.ParseInt("0b1000", 2, 0) // invalid syntax strconv.ParseInt("1000", 2, 0) // 8 A note on strconv.ParseInt 11 Go 1.13
{ io.ReadCloser io.WriteCloser } If the repeated methods have same signature, it’s valid code. Before Go 1.14, this code would fail. type ReadWriteCloser interface { io.ReadCloser io.WriteCloser // duplicate method Close } If the repeated methods have same signature, it’s valid code. Overlapping interfaces 17 Go 1.14
added ◦ /etc/ssl/cert.pem ◦ Not an issue as Alpine also links /etc/ssl/certs/ca-certificates.crt ◦ Still need apk add ca-certificates What’s up with TLS 22
library. # go test -bench=. BenchmarkCRC64-2 55501 21247 ns/op BenchmarkCRC32-2 55454 20055 ns/op BenchmarkFNV-2 99736 10743 ns/op BenchmarkFNVa-2 108721 10475 ns/op BenchmarkAdler32-2 313054 4004 ns/op BenchmarkMaphash-2 475030 2477 ns/op Is it the fastest hashing function available in Go? hash/maphash 32 Go 1.14
and TB. func Test_something(t *testing.T) { t.CleanUp(func() { fmt.Println("Clean up!") }) t.Run(tt.name,[...]) } This is useful with parallel tests and subtests Testing: Cleanup 39 Go 1.14
(default) - Modules are enabled in auto when the current directory, or one of its parents, contains a go.mod file. - The read-only GOMOD variable indicates in which mode you are. - Output of go env GOMOD: Go Modules: enabling 44 go.mod not found go.mod found GO111MODULE=off <nothing> <nothing> GO111MODULE=on /dev/null /path/to/go.mod GO111MODULE=auto <nothing> /path/to/go.mod
a := []int{1, 2, 3} fmt.Println(a[3]) In 1.12 and before: panic: runtime error: index out of range Since 1.13: panic: runtime error: index out of range [3] with length 3 Go 1.14
fast as a normal function call benchmark 1.12 ns/op 1.14 ns/op delta BenchmarkDefer-32 67.6 7.31 -89.19% BenchmarkDefer10-32 57.5 59.3 +3.13% BenchmarkDeferMany-32 157 168 +7.01% change: cmd/compile, cmd/link, runtime: make defers low-cost through inline code and extra funcdata Performance: defer Go 1.14
macOS 10.11 or later ▪ Go 1.14 last to support darwin/arm(32) ▪ Go 1.14 added freebsd/arm64 ▪ Go 1.14 might support Dragonfly, Illumos, Solaris ▪ Go 1.14 dropped NaCl
▪ Gophercon Israel, Tel Aviv February 3 ▪ CaptialGo, Washington DC March 27 ▪ Gophercon India, Goa March 28-29 ▪ Gophercon Russia, Moscow March 28 ▪ dotGo, Paris March 30 ▪ Gophercon Europe, Berlin April 23-26