Go

Go

Made by DeepSource

Redundant type assertions GO-W4015

Bug risk
Minor

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
}