mirror of
https://github.com/astaxie/beego.git
synced 2025-06-12 09:50:39 +00:00
golint all the files
This commit is contained in:
@ -42,18 +42,18 @@ func (o *queryM2M) Add(mds ...interface{}) (int64, error) {
|
||||
dbase := orm.alias.DbBaser
|
||||
|
||||
var models []interface{}
|
||||
var other_values []interface{}
|
||||
var other_names []string
|
||||
var otherValues []interface{}
|
||||
var otherNames []string
|
||||
|
||||
for _, colname := range mi.fields.dbcols {
|
||||
if colname != mfi.column && colname != rfi.column && colname != fi.mi.fields.pk.column &&
|
||||
mi.fields.columns[colname] != mi.fields.pk {
|
||||
other_names = append(other_names, colname)
|
||||
otherNames = append(otherNames, colname)
|
||||
}
|
||||
}
|
||||
for i, md := range mds {
|
||||
if reflect.Indirect(reflect.ValueOf(md)).Kind() != reflect.Struct && i > 0 {
|
||||
other_values = append(other_values, md)
|
||||
otherValues = append(otherValues, md)
|
||||
mds = append(mds[:i], mds[i+1:]...)
|
||||
}
|
||||
}
|
||||
@ -94,8 +94,8 @@ func (o *queryM2M) Add(mds ...interface{}) (int64, error) {
|
||||
values = append(values, v1, v2)
|
||||
|
||||
}
|
||||
names = append(names, other_names...)
|
||||
values = append(values, other_values...)
|
||||
names = append(names, otherNames...)
|
||||
values = append(values, otherValues...)
|
||||
return dbase.InsertValue(orm.db, mi, true, names, values)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user