File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -23,9 +23,9 @@ func main() {
2323 config.Addr = " your-hostname:your-port"
2424
2525 dumpDir := " dumps" // you should create this directory
26- dumpFilenameFormat := fmt.Sprintf (" %s -20060102T150405" , dbname ) // accepts time layout string and add .sql at the end of file
26+ dumpFilenameFormat := fmt.Sprintf (" %s -20060102T150405" , config. DBName ) // accepts time layout string and add .sql at the end of file
2727
28- db , err := sql.Open (" mysql" , config.FormatDNS ())
28+ db , err := sql.Open (" mysql" , config.FormatDSN ())
2929 if err != nil {
3030 fmt.Println (" Error opening database: " , err)
3131 return
@@ -39,12 +39,12 @@ func main() {
3939 }
4040
4141 // Dump database to file
42- resultFilename , err := dumper.Dump ()
42+ err := dumper.Dump ()
4343 if err != nil {
4444 fmt.Println (" Error dumping:" , err)
4545 return
4646 }
47- fmt.Printf (" File is saved to %s " , resultFilename )
47+ fmt.Printf (" File is saved to %s " , dumpFilenameFormat )
4848
4949 // Close dumper, connected database and file stream.
5050 dumper.Close ()
You can’t perform that action at this time.
0 commit comments