Skip to content

Commit

Permalink
Update dev-guide-sample-application-golang-sql-driver.md (#16087) (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Jan 24, 2024
1 parent 0cb038d commit a56895c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions develop/dev-guide-sample-application-golang-sql-driver.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func openDB(driverName string, runnable func(db *sql.DB)) {
```golang
openDB("mysql", func(db *sql.DB) {
insertSQL = "INSERT INTO player (id, coins, goods) VALUES (?, ?, ?)"
insertSQL := "INSERT INTO player (id, coins, goods) VALUES (?, ?, ?)"
_, err := db.Exec(insertSQL, "id", 1, 1)
if err != nil {
Expand All @@ -205,7 +205,7 @@ openDB("mysql", func(db *sql.DB) {
```golang
openDB("mysql", func(db *sql.DB) {
selectSQL = "SELECT id, coins, goods FROM player WHERE id = ?"
selectSQL := "SELECT id, coins, goods FROM player WHERE id = ?"
rows, err := db.Query(selectSQL, "id")
if err != nil {
panic(err)
Expand All @@ -230,7 +230,7 @@ openDB("mysql", func(db *sql.DB) {
```golang
openDB("mysql", func(db *sql.DB) {
updateSQL = "UPDATE player set goods = goods + ?, coins = coins + ? WHERE id = ?"
updateSQL := "UPDATE player set goods = goods + ?, coins = coins + ? WHERE id = ?"
_, err := db.Exec(updateSQL, 1, -1, "id")
if err != nil {
Expand All @@ -245,7 +245,7 @@ openDB("mysql", func(db *sql.DB) {
```golang
openDB("mysql", func(db *sql.DB) {
deleteSQL = "DELETE FROM player WHERE id=?"
deleteSQL := "DELETE FROM player WHERE id=?"
_, err := db.Exec(deleteSQL, "id")
if err != nil {
Expand Down

0 comments on commit a56895c

Please sign in to comment.