Index: golden/go/correctness_migratedb/main.go |
diff --git a/golden/go/correctness_migratedb/main.go b/golden/go/correctness_migratedb/main.go |
index 45ab64e4d240b48028d27ecd67170e06625efa7d..37e4e963f1d6cf7634be4f970820193d38699882 100644 |
--- a/golden/go/correctness_migratedb/main.go |
+++ b/golden/go/correctness_migratedb/main.go |
@@ -5,11 +5,7 @@ package main |
// it is not entered via the command line. |
import ( |
- "bufio" |
"flag" |
- "fmt" |
- "os" |
- "strings" |
"github.com/golang/glog" |
"skia.googlesource.com/buildbot.git/go/common" |
@@ -28,23 +24,9 @@ func main() { |
// Global init to initialize glog and parse arguments. |
common.Init() |
- var connectionStr = *dbConnString |
- |
- // if it contains formatting information read the password from stdin. |
- if strings.Contains(connectionStr, "%s") { |
- glog.Infof("Using connection string: %s", connectionStr) |
- reader := bufio.NewReader(os.Stdin) |
- fmt.Print("Enter password for MySQL: ") |
- password, err := reader.ReadString('\n') |
- if err != nil { |
- glog.Fatalf("Unable to read password. Error: %s", err) |
- } |
- connectionStr = fmt.Sprintf(connectionStr, strings.TrimRight(password, "\n")) |
- } |
- |
- conf := &database.DatabaseConfig{ |
- MySQLString: connectionStr, |
- MigrationSteps: db.MigrationSteps(), |
+ conf, err := database.ResolveCustomMySQLString(*dbConnString, db.MigrationSteps()) |
+ if err != nil { |
+ glog.Fatal(err) |
} |
vdb := database.NewVersionedDB(conf) |