911}
912
913// return prepared raw statement for used in times.
914func (o *rawSet) Prepare() (RawPreparer, error) {915 return newRawPreparer(o)
916}
917
906// Total int
907// Found int
908// }
909func (o *rawSet) RowsToStruct(ptrStruct interface{}, keyCol, valueCol string) (int64, error) {910 return o.queryRowsTo(ptrStruct, keyCol, valueCol)
911}
912
891// "total": 100,
892// "found": 200,
893// }
894func (o *rawSet) RowsToMap(result *Params, keyCol, valueCol string) (int64, error) {895 return o.queryRowsTo(result, keyCol, valueCol)
896}
897
876}
877
878// query data to []interface
879func (o *rawSet) ValuesFlat(container *ParamsList, cols ...string) (int64, error) {880 return o.readValues(container, cols)
881}
882
871}
872
873// query data to [][]interface
874func (o *rawSet) ValuesList(container *[]ParamsList, cols ...string) (int64, error) {875 return o.readValues(container, cols)
876}
877
(Go's FAQ)[https://go.dev/doc/faq#methodsonvaluesorpointers] recommends that method receivers should be consistent. If some of the methods of the type must have pointer receivers, the rest should too, so the method set is consistent regardless of how the type is used. This is because value and pointer receivers have different method sets.
package main
type foo struct {
a int
}
func (f foo) a() {}
func (f *foo) b() {
f.a = 10
}
package main
type foo struct {
a int
}
func (f *foo) a() {}
func (f *foo) b() {
f.a = 10
}