← All recipes
Moderne licensed

Add the testify dependency to go.mod

Recipe IDorg.openrewrite.golang.testify.AddTestifyDependencyArtifactgithub.com/moderneinc/recipes-go

Add a require github.com/stretchr/testify directive to go.mod when a package in the module imports testify but go.mod does not yet require it. Does not sync go.sum or add transitive dependencies; a go mod tidy is still needed to complete resolution.

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.AddTestifyDependency

If the recipe isn’t available locally, install it with:

mod config recipes go install github.com/moderneinc/recipes-go