Skip to content

Commit

Permalink
Remove unused err argument to makeReady()
Browse files Browse the repository at this point in the history
  • Loading branch information
flimzy committed Oct 11, 2023
1 parent 4e0e919 commit 77cada0
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions resultset.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ func (r *ResultSet) Metadata() (*ResultMetadata, error) {
//
// Refer to the documentation for [encoding/json.Unmarshal] for unmarshaling
// details.
func (r *ResultSet) ScanValue(dest interface{}) (err error) {
runlock, err := r.makeReady(&err)
func (r *ResultSet) ScanValue(dest interface{}) error {
runlock, err := r.makeReady()
if err != nil {
return err
}
Expand All @@ -174,8 +174,8 @@ func (r *ResultSet) ScanValue(dest interface{}) (err error) {
//
// If the row returned an error, it will be returned rather than
// unmarshaling the doc, as error rows do not include docs.
func (r *ResultSet) ScanDoc(dest interface{}) (err error) {
runlock, err := r.makeReady(&err)
func (r *ResultSet) ScanDoc(dest interface{}) error {
runlock, err := r.makeReady()
if err != nil {
return err
}
Expand All @@ -196,8 +196,8 @@ func (r *ResultSet) ScanDoc(dest interface{}) (err error) {
//
// Unlike [ResultSet.ScanValue] and [ResultSet.ScanDoc], this may successfully
// scan the key, and also return an error, if the row itself represents an error.
func (r *ResultSet) ScanKey(dest interface{}) (err error) {
runlock, err := r.makeReady(&err)
func (r *ResultSet) ScanKey(dest interface{}) error {
runlock, err := r.makeReady()

Check warning on line 200 in resultset.go

View check run for this annotation

Codecov / codecov/patch

resultset.go#L199-L200

Added lines #L199 - L200 were not covered by tests
if err != nil {
return err
}
Expand All @@ -211,7 +211,7 @@ func (r *ResultSet) ScanKey(dest interface{}) (err error) {

// ID returns the ID of the most recent result.
func (r *ResultSet) ID() (string, error) {
runlock, err := r.makeReady(nil)
runlock, err := r.makeReady()
if err != nil {
return "", err
}
Expand All @@ -224,7 +224,7 @@ func (r *ResultSet) ID() (string, error) {
// as those from views) include revision IDs, so this will return an empty
// string in such cases.
func (r *ResultSet) Rev() (string, error) {
runlock, err := r.makeReady(nil)
runlock, err := r.makeReady()

Check warning on line 227 in resultset.go

View check run for this annotation

Codecov / codecov/patch

resultset.go#L227

Added line #L227 was not covered by tests
if err != nil {
return "", err
}
Expand All @@ -236,7 +236,7 @@ func (r *ResultSet) Rev() (string, error) {
// Key returns the Key of the most recent result as a raw JSON string. For
// compound keys, [ResultSet.ScanKey] may be more convenient.
func (r *ResultSet) Key() (string, error) {
runlock, err := r.makeReady(nil)
runlock, err := r.makeReady()
if err != nil {
return "", err
}
Expand All @@ -248,7 +248,7 @@ func (r *ResultSet) Key() (string, error) {
// Attachments returns an attachments iterator if the document includes
// attachments.
func (r *ResultSet) Attachments() (*AttachmentsIterator, error) {
runlock, err := r.makeReady(nil)
runlock, err := r.makeReady()
if err != nil {
return nil, err
}
Expand All @@ -269,7 +269,7 @@ func (r *ResultSet) Attachments() (*AttachmentsIterator, error) {

// makeReady ensures that the iterator is ready to be read from. If i.err is
// set, it is returned.
func (r *ResultSet) makeReady(_ *error) (unlock func(), err error) {
func (r *ResultSet) makeReady() (unlock func(), err error) {
r.mu.Lock()
if r.err != nil {
r.mu.Unlock()
Expand Down

0 comments on commit 77cada0

Please sign in to comment.