diff --git a/cmd/goose/main.go b/cmd/goose/main.go index 607ef70..b734eef 100644 --- a/cmd/goose/main.go +++ b/cmd/goose/main.go @@ -26,7 +26,7 @@ func main() { } if *verbose { - goose.SetVerbosity(goose.VerboseOn) + goose.SetVerbose(true) } switch args[0] { diff --git a/goose.go b/goose.go index aaca01a..b83c778 100644 --- a/goose.go +++ b/goose.go @@ -8,28 +8,18 @@ import ( "sync" ) -// VerboseMode is the goose verbosity -type VerboseMode bool - -const ( - // VerboseOn is the goose verbose mode - VerboseOn VerboseMode = true - // VerboseOff is the goose silent mode - VerboseOff VerboseMode = false -) - var ( duplicateCheckOnce sync.Once minVersion = int64(0) maxVersion = int64((1 << 63) - 1) timestampFormat = "20060102150405" - verbose = VerboseOff + verbose = false reMatchSQLComments = regexp.MustCompile(`(--.*)`) ) -// SetVerbosity defines the goose verbosity -func SetVerbosity(vl VerboseMode) { - verbose = vl +// SetVerbose set the goose verbosity mode +func SetVerbose(v bool) { + verbose = v } // Run runs a goose command. diff --git a/migration_sql.go b/migration_sql.go index 3702b0e..7eb9348 100644 --- a/migration_sql.go +++ b/migration_sql.go @@ -202,7 +202,7 @@ func runSQLMigration(db *sql.DB, scriptFile string, v int64, direction bool) err } func printInfo(s string, args ...interface{}) { - if verbose == VerboseOn { + if verbose { log.Printf(s, args...) } }