MCPcopy Create free account
hub / github.com/lib/pq / Close

Method Close

rows.go:43–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41)
42
43func (rs *rows) Close() error {
44 if finish := rs.finish; finish != nil {
45 defer finish()
46 }
47 // no need to look at cn.bad as Next() will
48 for {
49 err := rs.Next(nil)
50 switch err {
51 case nil:
52 case io.EOF:
53 // rs.Next can return io.EOF on both ReadyForQuery and
54 // RowDescription (used with HasNextResultSet). We need to fetch
55 // messages until we hit a ReadyForQuery, which is done by waiting
56 // for done to be set.
57 if rs.done {
58 return nil
59 }
60 default:
61 return err
62 }
63 }
64}
65
66func (rs *rows) Columns() []string {
67 return rs.colNames

Callers

nothing calls this directly

Calls 1

NextMethod · 0.95

Tested by

no test coverage detected