Skip to content

Supported Generators

gogenfilter detects files generated by 11 code generation tools through a two-phase approach: filename patterns first (zero I/O), then content markers.

ToolFilename DetectionContent Detection
sqlcmodels.go, querier.go, query.sql.go, batch.go, *.sql.go"Code generated by sqlc", sqlc code patterns
templ_templ.go suffixtempl.Component, Render(ctx context.Context, w io.Writer)
go-enum_enum.go suffix"Code generated by go-enum"
protobuf.pb.go, _grpc.pb.go suffixAny Code generated by comment
oapi-codegenNone"oapi-codegen" content marker
deepcopy-genzz_generated.* prefix + .go suffix"Code generated by deepcopy-gen"
wirewire_gen.go suffix"Code generated by Wire"
moq_moq.go, _moq_test.go suffix"Code generated by moq"
mockgen_mock.go suffix, mock_ prefix"Code generated by MockGen"
stringerNone"Code generated by \"stringer\""
Generic fallbackNoneAny // Code generated by comment

The generic detector catches any tool that follows Go’s standard code generation comment convention from go.dev/s/generatedcode. This means even tools not explicitly supported will be detected if they include the standard comment.

The detector table is the single source of truth. Each entry has:

  • An option (FilterOption)
  • A reason (FilterReason)
  • An optional matchFilename function (Phase 1)
  • An optional checkContent function (Phase 2)

Derived lists like AllFilterOptions() and AllFilterReasons() are auto-generated from this table.