Go sql.open connection address placeholder

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(err)
}
mysqlhost := cfg.Section("mysql").Key("host").String()
mysqluser := cfg.Section("mysql").Key("user").String()
mysqlpassword := cfg.Section("mysql").Key("password").String()
mysqldatabase := cfg.Section("mysql").Key("database").String()
dbconn, err = sql.Open("mysql", "%s:%s@tcp(%s)/%s?charset=utf8&parseTime=True&loc=Local")
Jan.08,2022

concatenate DSN of mysql connections with strings from the standard library

conn = fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8&parseTime=True&loc=Local", 
    mysqluser, 
    mysqlpassword,
    mysqlhost,
    mysqldatabase,
)
dbconn, err = sql.Open("mysql", conn)
Menu