Go

Go

By DeepSource

Redundant type assertions GO-W4015

Bug risk

Redundant type assertion could be avoided in cases where from and type asserted to are identical.

Examples

Bad practice

func f(w io.Writer) interface{} {
    return w.(interface{})
}

Recommended

func f(w io.Writer) interface{} {
    return w
}