From 750a384be22329e7ffc0113f4cb6a478c4bfc906 Mon Sep 17 00:00:00 2001 From: Andrew Benton Date: Thu, 26 Oct 2023 15:25:56 -0700 Subject: [PATCH] add some comments --- internal/cmd/shim.go | 6 +++--- internal/codegen/golang/opts/go_type.go | 1 + internal/codegen/golang/opts/override.go | 1 + internal/codegen/golang/opts/plugin_override.go | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/cmd/shim.go b/internal/cmd/shim.go index 36820894e6..87d33f42df 100644 --- a/internal/cmd/shim.go +++ b/internal/cmd/shim.go @@ -53,16 +53,16 @@ func pluginOverride(r *compiler.Result, o config.Override) *plugin.Override { } func pluginSettings(r *compiler.Result, cs config.CombinedSettings) *plugin.Settings { - var overrides []*plugin.Override + var over []*plugin.Override for _, o := range cs.Overrides { - overrides = append(overrides, pluginOverride(r, o)) + over = append(over, pluginOverride(r, o)) } return &plugin.Settings{ Version: cs.Global.Version, Engine: string(cs.Package.Engine), Schema: []string(cs.Package.Schema), Queries: []string(cs.Package.Queries), - Overrides: overrides, + Overrides: over, Rename: cs.Rename, Codegen: pluginCodegen(cs, cs.Codegen), } diff --git a/internal/codegen/golang/opts/go_type.go b/internal/codegen/golang/opts/go_type.go index 13064bacd3..af3db71bde 100644 --- a/internal/codegen/golang/opts/go_type.go +++ b/internal/codegen/golang/opts/go_type.go @@ -1,3 +1,4 @@ +// Copied from github.com/sqlc-dev/sqlc/internal/config/go_type.go with minor changes to ParsedGoType package opts import ( diff --git a/internal/codegen/golang/opts/override.go b/internal/codegen/golang/opts/override.go index b740c9738c..29e19d311a 100644 --- a/internal/codegen/golang/opts/override.go +++ b/internal/codegen/golang/opts/override.go @@ -1,3 +1,4 @@ +// Copied from github.com/sqlc-dev/sqlc/internal/config/override.go and removed Engine field from Override package opts import ( diff --git a/internal/codegen/golang/opts/plugin_override.go b/internal/codegen/golang/opts/plugin_override.go index 0d6367bab7..62a1d2521e 100644 --- a/internal/codegen/golang/opts/plugin_override.go +++ b/internal/codegen/golang/opts/plugin_override.go @@ -1,3 +1,4 @@ +// Extracted from github.com/sqlc-dev/sqlc/internal/cmd/shim.go package opts import (