diff --git a/internal/cmd/generate.go b/internal/cmd/generate.go index 589295e74d..b479670e5d 100644 --- a/internal/cmd/generate.go +++ b/internal/cmd/generate.go @@ -367,14 +367,6 @@ func codegen(ctx context.Context, combo config.CombinedSettings, sql outPair, re var handler ext.Handler var out string switch { - case sql.Gen.Go != nil: - out = combo.Go.Out - handler = ext.HandleFunc(golang.Generate) - - case sql.Gen.JSON != nil: - out = combo.JSON.Out - handler = ext.HandleFunc(json.Generate) - case sql.Plugin != nil: out = sql.Plugin.Out plug, err := findPlugin(combo.Global, sql.Plugin.Plugin) @@ -404,6 +396,14 @@ func codegen(ctx context.Context, combo config.CombinedSettings, sql outPair, re } req.PluginOptions = opts + case sql.Gen.Go != nil: + out = combo.Go.Out + handler = ext.HandleFunc(golang.Generate) + + case sql.Gen.JSON != nil: + out = combo.JSON.Out + handler = ext.HandleFunc(json.Generate) + default: return "", nil, fmt.Errorf("missing language backend") }