Skip to content

Commit fd040bc

Browse files
committed
revert Combine
1 parent 1ef6c1b commit fd040bc

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

internal/cmd/process.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ func processQuerySets(ctx context.Context, rp ResultProcessor, conf *config.Conf
6868
errout := &stderrs[i]
6969

7070
grp.Go(func() error {
71-
combo := config.Combine(*conf, sql.SQL, dir)
71+
combo := config.Combine(*conf, sql.SQL)
72+
if dir != "" {
73+
combo.Dir = dir
74+
}
7275
if sql.Plugin != nil {
7376
combo.Codegen = *sql.Plugin
7477
}

internal/cmd/vet.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,10 @@ func (c *checker) DSN(dsn string) (string, error) {
464464

465465
func (c *checker) checkSQL(ctx context.Context, s config.SQL) error {
466466
// TODO: Create a separate function for this logic so we can
467-
combo := config.Combine(*c.Conf, s, c.Dir)
467+
combo := config.Combine(*c.Conf, s)
468+
if c.Dir != "" {
469+
combo.Dir = c.Dir
470+
}
468471

469472
// TODO: This feels like a hack that will bite us later
470473
joined := make([]string, 0, len(s.Schema))

internal/config/config.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,10 @@ type CombinedSettings struct {
331331
Dir string
332332
}
333333

334-
func Combine(conf Config, pkg SQL, dir string) CombinedSettings {
334+
func Combine(conf Config, pkg SQL) CombinedSettings {
335335
cs := CombinedSettings{
336336
Global: conf,
337337
Package: pkg,
338-
Dir: dir,
339338
}
340339
if pkg.Gen.Go != nil {
341340
cs.Go = *pkg.Gen.Go

0 commit comments

Comments
 (0)