Go-1.16-and-beyond

A quick tour of Go 1.16 @ 16th Golang Leipzig Meetup

Our 16th Meetup at the 16th of February with a quick tour on Go 1.16 😊 . We will also have an outlook on the Go generics proposal.

Go 1.16 is expected to be released this Februrary! 🎉 🎆

From the preliminary release notes

Modules

Other


A deeper look on the new embed package

os and io/fs

type FS interface {
    Open(name string) (File, error)
}
type DeleteFS interface {
  FS

  Delete(name string) error
}

Generics

The proposal got accepted 🎉

func print[T any](value T) {
    fmt.Printf("type=%T\tvalue=%#v\n", value, value)
}

print([]int{1, 2, 3, 4})
print("Hello, Golang Leipzig!")

playground

type Number interface {
    type int, float64
}

func sum[T, S Number](a T, b S) S {
    return S(a) + b
}

sum(1, 3.1415)

playground

Questions