Adopt testify require.Nil

Proprietary

Replace if x != nil { t.Fatal(...) } with require.Nil(t, x) and if x == nil { t.Fatal(...) } with require.NotNil(t, x) from github.com/stretchr/testify/require, for non-error operands. Error operands are handled by the NoError / Error recipes.

org.openrewrite.golang.testify.AdoptTestifyRequireNil
mod run . --recipe=org.openrewrite.golang.testify.AdoptTestifyRequireNil

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.