-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug fixes / context refactor #32
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some minor comments, let me know what you think!
defer cancel() | ||
|
||
ctx = tctx | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it' a bit artificial but can we move lines 93:116 to a prepareQuery
method? That way we can easily add tests for new/existing code without having to mock the query execution.
count, err := frame.RowLen() | ||
|
||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
if count == 0 { | ||
return nil, ErrorNoResults | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it'd be also great to have some test for this, since this is the fix of #16
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'd be great to have more tests but don't want to block this PR for that.
I'm with you but I think I want to do some refactoring to make this more testable first 🙈 |
Fixes #16
Before:
After:
Also includes fixes:
github.com/pkg/errors
, instead we just use the standard libraryerrors
package withfmt.Errorf
.github.com/pkg/errors
in favor oferrors
#31This does include a breaking change because of the new function on the interface.