Use comma-ok type assertion
ProprietaryTransform bare type assertions v := x.(T) into v, ok := x.(T) with _ = ok to avoid panics on assertion failure.
org. openrewrite. golang. codequality. UseCommaOkTypeAssertionmod run . --recipe= org. openrewrite. golang. codequality. UseCommaOkTypeAssertionInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.