379
380// aggregate func
381func (o querySet) Aggregate(s string) QuerySeter {
382 o.aggregate = s383 return &o
384}
216
217// Set condition to QuerySeter.
218func (o querySet) SetCond(cond *Condition) QuerySeter {
219 o.cond = cond220 return &o
221}
222
205 case string:
206 o.related = append(o.related, val)
207 case int:
208 o.relDepth = val209 default:
210 panic(fmt.Errorf("<QuerySeter.RelatedSel> wrong param kind: %v", val))
211 }
198// it will query relation models and assign to parent model.
199func (o querySet) RelatedSel(params ...interface{}) QuerySeter {
200 if len(params) == 0 {
201 o.relDepth = DefaultRelsDepth202 } else {
203 for _, p := range params {
204 switch val := p.(type) {
189
190// IgnoreIndex ignore index for query
191func (o querySet) IgnoreIndex(indexes ...string) QuerySeter {
192 o.useIndex = hints.KeyIgnoreIndex193 o.indexes = indexes
194 return &o
195}
A method that modifies its receiver value can have undesired behavior. The modification can also be the root of a bug because the actual value receiver could be a copy of that used at the calling site. This rule warns when a method modifies its receiver.
type data struct {
num int
key *string
items map[string]bool
}
func (d data) vmethod() {
d.num = 8
}
type data struct {
num int
key *string
items map[string]bool
}
func (d *data) vmethod() {
d.num = 8
}