Remove empty functions
Recipe ID
org.openrewrite.golang.codequality.RemoveEmptyFunctionArtifactgithub.com/moderneinc/recipes-goRemove unexported free functions with empty bodies and no return type. main in package main and init are preserved because the runtime invokes them rather than other code. Methods with receivers are preserved because they may implement an interface. Exported functions are preserved because removing one breaks importers.
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.RemoveEmptyFunctionIf the recipe isn’t available locally, install it with:
mod config recipes go install github.com/moderneinc/recipes-go