Welcome to the Go 1.14 Release Party!
https://www.crowdcast.io/e/pdx-go-march-12-2020
Go 1.14 comes with a change in how the runtime does preemption of Goroutines.
Go 1.14 comes with two nice additions for testing. Previously, we had to implement this stuff ourselves and it was hard.
When we're writing tests, we often have to clean up after ourselves after we're done. For example, we might need to delete a database table or close a connection. Before 1.14, we had to come up with our own ways to reliably clean up. Now, Go has a native way to cleanup. The *testing.T
and *testing.B
types both have a Cleanup(func())
method on them.
When we ran go test -v
, Go waited until the end of the test to print all of the strings passed to t.Log
.
Sometimes it's more helpful to have the output streamed as it happens. Now, if you run go test -v
, each t.Log
call gets flushed to STDOUT
as it happens.
- Release notes are here (see the "testing" header at the bottom of the section)
- Code samples are here
- Run them with
go test -v stream_test.go
- Run them with
Before 1.14, you couldn't do this:
type Interface1 {
Hello()
}
type Interface2 {
Hello()
}
type Interface3 {
Interface1
Interface2
}
But now you can!