← All recipes
Moderne licensed

Prefer filepath.Clean over redundant filepath.Join

Recipe IDorg.openrewrite.golang.codequality.PreferFilepathCleanArtifactgithub.com/moderneinc/recipes-go

Replace filepath.Join(filepath.Clean(p)) with filepath.Clean(p) since Join with a single already-cleaned argument is redundant.

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.codequality.PreferFilepathClean

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

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