Skip to content

Commit

Permalink
docs: tabs to space
Browse files Browse the repository at this point in the history
  • Loading branch information
aldy505 committed Jun 30, 2021
1 parent 80893d1 commit 75547d6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ func main() {

// Check if a table is exists
sql, args, err = bob.HasTable("users").PlaceholderFormat(bob.Dollar).ToSQL()
if err != nil {
log.Fatal(err)
}
if err != nil {
log.Fatal(err)
}

var hasTableUsers bool
err = db.QueryRow(context.Background(), sql, args...).Scan(&hasTableUsers)
if err != nil {
if err.Error() == "no rows in result set" {
hasTableUsers = false
} else {
log.Fatal(err)
}
hasTableUsers = false
} else {
log.Fatal(err)
}
}

if !hasTableUsers {
Expand All @@ -57,9 +57,9 @@ func main() {
splitQuery := strings.Split(sql, ";")
for i := range splitQuery {
_, err = db.Query(context.Background(), splitQuery[i])
if err != nil {
if err != nil {
log.Fatal(err)
}
}
}
}
}
Expand Down

0 comments on commit 75547d6

Please sign in to comment.