How does go handle the err returned when operating mysql

func DBGetAdd(t string, n string, v string) map[string]string {
    sql := "insert into "+t+"("+n+") values("+v+")"
    //
    ret, err := DB.Exec(sql);
    d := map[string]string{}
        if err != nil {
            fmt.Println(err)
            fmt.Printf("%T\n",err)
            d["state"] = "error"
            d["data"] = "error"
            return d
        }
}

insert a piece of data into mysql. I want to return the contents in err and find that err is * mysql.MySQLError type. How to use err as string

Jun.22,2022

e: = fmt.Sprintf ("% s", err)

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-7c0df5-1deed.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-7c0df5-1deed.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?