Skip to content

Commit

Permalink
Factor away GlobalSlonik
Browse files Browse the repository at this point in the history
  • Loading branch information
williammoran committed May 1, 2024
1 parent 14a4b5e commit 0f7e5a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/dbsteward.go
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ func (self *DBSteward) doSqlDiff(oldSql, newSql []string, outputFile string) {
}
func (self *DBSteward) doSlonikConvert(file string, outputFile string) {
// TODO(go,nth) is there a nicer way to handle this output idiom?
output := GlobalSlonik.Convert(file)
output := NewSlonik().Convert(file)
if len(outputFile) > 0 {
err := util.WriteFile(output, outputFile)
self.FatalIfError(err, "Failed to save slonikconvert output to %s", outputFile)
Expand Down
5 changes: 1 addition & 4 deletions lib/slonik.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package lib

// TODO(go,3) no globals
var GlobalSlonik *Slonik = NewSlonik()

type Slonik struct{}

func NewSlonik() *Slonik {
return &Slonik{}
}

func (self *Slonik) Convert(file string) string {
func (slonik *Slonik) Convert(file string) string {
// TODO(go,core)
return ""
}

0 comments on commit 0f7e5a0

Please sign in to comment.