Adopt testify require.Nil
Recipe ID
org.openrewrite.golang.testify.AdoptTestifyRequireNilArtifactgithub.com/moderneinc/recipes-goReplace 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.
Single recipeProprietary
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.golang.testify.AdoptTestifyRequireNilIf the recipe isn’t available locally, install it with:
mod config recipes go install github.com/moderneinc/recipes-go