Skip to content

Commit

Permalink
fix: 🪲 Variable Scope
Browse files Browse the repository at this point in the history
*sql.DB invalid memory address or nil pointer dereference

Source solution: go-sql-driver/mysql#150 (comment)
  • Loading branch information
jmillandev committed Jun 12, 2021
1 parent 8cb9c52 commit c88b469
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datasources/mysql/users_db/users_db.go
Expand Up @@ -29,7 +29,7 @@ func init() {
log.Println(fmt.Sprintf("about to connect to %s", dataSourceName))

var err error
Client, err := sql.Open("mysql", dataSourceName)
Client, err = sql.Open("mysql", dataSourceName)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit c88b469

Please sign in to comment.