Drop driver's Executor.Exec first return value (which is empty)#936
Merged
Conversation
Here, drop the first return value of the driver's `Executor.Exec`
function, which previously returned a `struct{}` in first position. When
I was first putting this all in, I figured it'd be better for consistency
if all driver functions returned exactly two values, even if one wasn't
really needed. Since then, we've picked up lots of driver functions that
return only an error, so that original premise doesn't hold anymore.
Returning only an error is advantageous in some cases because it lets
the return value be passed directly into functions. e.g.
require.NoError(t, exec.Exec(ctx, ...))
I've been meaning to make this change for a while, and it seems like a
good time now given we're going to be making lots of changes to the
driver interface for the next release anyway.
bgentry
approved these changes
May 28, 2025
Contributor
Author
|
ty. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here, drop the first return value of the driver's
Executor.Execfunction, which previously returned a
struct{}in first position. WhenI was first putting this all in, I figured it'd be better for consistency
if all driver functions returned exactly two values, even if one wasn't
really needed. Since then, we've picked up lots of driver functions that
return only an error, so that original premise doesn't hold anymore.
Returning only an error is advantageous in some cases because it lets
the return value be passed directly into functions. e.g.
I've been meaning to make this change for a while, and it seems like a
good time now given we're going to be making lots of changes to the
driver interface for the next release anyway.