Generics when to use them and when it’s not:

Common useful cases:

Common not useful cases:

func foo[T io.Writer](w T) {
b := getBytes()
_, _ = w.Write(b)
}

In this case, using generics won’t bring any value to our code whatsoever. We should make the w argument an io.Writer directly.