package mysql import "github.com/jinzhu/gorm" type Report struct { gorm.Model Message string `gorm:"type:longtext"` Source string Line string Colno string Err string `gorm:"type:longtext"` Aid string Sid string Uid string Channel string Path string } func (report *Report) Create() error { res := DB.Create(report) if res.Error != nil { return res.Error } return nil }