← All recipes
Moderne licensed

Point //go:generate mockgen at go.uber.org/mock

Recipe IDorg.openrewrite.golang.migration.UpdateMockgenGoGenerateDirectivesArtifactgithub.com/moderneinc/recipes-go

Rewrite github.com/golang/mock to go.uber.org/mock inside //go:generate directives, so go generate runs the maintained mockgen. Covers both the go run github.com/golang/mock/mockgen form and the vendored go run ./vendor/github.com/golang/mock/mockgen form.

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.migration.UpdateMockgenGoGenerateDirectives

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

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