Skip to content
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

[]byte should not be expanded by In #340

Merged
merged 2 commits into from
Feb 28, 2018
Merged

Conversation

npiganeau
Copy link
Contributor

[]byte is one of the driver.Value types, and should therefore not be expanded by In.

[]byte is one of the driver.Value types, and should therefore not be expanded by `In`.
bind.go Outdated
@@ -113,7 +113,7 @@ func In(query string, args ...interface{}) (string, []interface{}, error) {
v := reflect.ValueOf(arg)
t := reflectx.Deref(v.Type())

if t.Kind() == reflect.Slice {
if t.Kind() == reflect.Slice && t != reflect.TypeOf([]byte{}) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment explaining this exception and add a test case to TestIn in sqlx_test.go.

@jmoiron jmoiron closed this Feb 28, 2018
@jmoiron jmoiron reopened this Feb 28, 2018
@jmoiron jmoiron merged commit 9adbc06 into jmoiron:master Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants