vendor dependencies with dep
This commit is contained in:
parent
93d8310491
commit
1384296a47
2712 changed files with 965742 additions and 0 deletions
35
vendor/github.com/go-pg/pg/orm/model_slice.go
generated
vendored
Normal file
35
vendor/github.com/go-pg/pg/orm/model_slice.go
generated
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
package orm
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
|
||||
"github.com/go-pg/pg/internal"
|
||||
)
|
||||
|
||||
type sliceModel struct {
|
||||
hookStubs
|
||||
slice reflect.Value
|
||||
scan func(reflect.Value, []byte) error
|
||||
}
|
||||
|
||||
var _ Model = (*sliceModel)(nil)
|
||||
|
||||
func (m *sliceModel) Init() error {
|
||||
if m.slice.IsValid() && m.slice.Len() > 0 {
|
||||
m.slice.Set(m.slice.Slice(0, 0))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *sliceModel) NewModel() ColumnScanner {
|
||||
return m
|
||||
}
|
||||
|
||||
func (sliceModel) AddModel(_ ColumnScanner) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *sliceModel) ScanColumn(colIdx int, _ string, b []byte) error {
|
||||
v := internal.SliceNextElem(m.slice)
|
||||
return m.scan(v, b)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue