Skip to content

Commit fc32b6f

Browse files
committed
Fixed RunWrite not defering its call to Cursor.Close().
Fixes #263
1 parent 2b23fbd commit fc32b6f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## Unreleased
6+
7+
### Fixed
8+
- Fixed `RunWrite` not defering its call to `Cursor.Close()`. This could cause issues if an error occurred when decoding the result.
9+
510
## v1.3.0 - 2016-01-11
611

712
### Added

query.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,15 +253,12 @@ func (t Term) RunWrite(s *Session, optArgs ...RunOpts) (WriteResponse, error) {
253253
if err != nil {
254254
return response, err
255255
}
256+
defer res.Close()
256257

257258
if err = res.One(&response); err != nil {
258259
return response, err
259260
}
260261

261-
if err = res.Close(); err != nil {
262-
return response, err
263-
}
264-
265262
if response.Errors > 0 {
266263
return response, fmt.Errorf(response.FirstError)
267264
}

0 commit comments

Comments
 (0)