err in line 316 does not exist in scope.
golang has block-level scope. You need to define err outside the if/else above line 316
var err error
if wid == 100017927 {
_, err = xxx
} else {
_, err = xxx
}
if err == nil {
}
Previous: Shorthand for vue events?
Next: Does the front end need to learn markdown, and what are the usage scenarios?
for example, go connection mysql, https: github.com jmoiron sqlx is a client that implements official database sql, and an additional driver: https: github.com go-sql-dri. is required to use it. but this is not the case when I connect to mongodb. ...
Gorm is used with MySQL. Db.Save cannot insert data into the database related codes type Like struct { ID int `gorm:"primary_key"` Ip string `gorm:"type:varchar(20);not null;index:ip_idx"` Ua st...
I read the mysql information from the configuration file. How do mysql hosts, users, passwords, and database names be passed to sql.open () as variables? cfg, err := ini.Load("setting.ini") cfg.BlockMode = false if err != nil { panic(er...
what should you do if the ip of the server is dynamic and you want to connect to the database with ip whitelist on another server I tried to fill in the whitelist of the database with the domain name after ddns, and found that it didn t work. How do ...