MCPcopy Create free account
hub / github.com/go-pg/pg / ScanColumn

Method ScanColumn

pg.go:156–165  ·  view source on GitHub ↗

ScanColumn scans the columns and appends them to `strings`.

(col types.ColumnInfo, rd types.Reader, n int)

Source from the content-addressed store, hash-verified

154
155// ScanColumn scans the columns and appends them to `strings`.
156func (strings *Strings) ScanColumn(col types.ColumnInfo, rd types.Reader, n int) error {
157 b := make([]byte, n)
158 _, err := io.ReadFull(rd, b)
159 if err != nil {
160 return err
161 }
162
163 *strings = append(*strings, internal.BytesToString(b))
164 return nil
165}
166
167// AppendValue appends the values from `strings` to the given byte slice.
168func (strings Strings) AppendValue(dst []byte, quote int) ([]byte, error) {

Callers

nothing calls this directly

Calls 2

BytesToStringFunction · 0.92
ReadFullMethod · 0.65

Tested by

no test coverage detected