package comms import gocloud "github.com/mgr9525/go-cloud" func XormOne(id, e interface{}, column ...string) bool { return XormOneDb(DbSysHelper, id, e, column...) } func XormOneDb(db *gocloud.DBHelper, id, e interface{}, column ...string) bool { if id == nil { return false } col := "id" if len(column) > 0 && column[0] != "" { col = column[0] } has, err := db.GetDB().Where(col+" = ?", id).Get(e) if err != nil { return false } if !has { return false } return true }