Skip to content

Commit c2fe4af

Browse files
authored
Update README.md
1 parent d66f8c4 commit c2fe4af

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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()

0 commit comments

Comments
 (0)