1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-02 10:56:25 -07:00

Fixed empty query catch code

This commit is contained in:
comraderat 2020-05-19 23:14:50 +02:00
parent 26782d05cf
commit bb54b82630

View file

@ -104,8 +104,11 @@ func initDB(initFile string) error {
sqlArr := strings.Split(sqlReplacer.Replace(sqlStr), ";")
for _, statement := range sqlArr {
if statement != "" && statement != " " {
statement = strings.Trim(statement, " \n\r\t")
if len(statement) > 0 {
if _, err = db.Exec(statement); err != nil {
print(len(statement))
fmt.Printf("%08b", []byte(statement))
return err
}
}