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

PutObject: handle blobs correctly #152

Merged
merged 1 commit into from
Nov 16, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,18 @@ func valueToInterface(f reflect.Value, clusterSupportsFloat bool) interface{} {
return nil
}

// convert to primitives recursively
newSlice := make([]interface{}, f.Len(), f.Cap())
for i := 0; i < len(newSlice); i++ {
newSlice[i] = valueToInterface(f.Index(i), clusterSupportsFloat)
}
if f.Kind() == reflect.Slice && reflect.TypeOf(f.Interface()).Elem().Kind() == reflect.Uint8 {
// handle blobs
return f.Interface().([]byte)
} else {
// convert to primitives recursively
newSlice := make([]interface{}, f.Len(), f.Cap())
for i := 0; i < len(newSlice); i++ {
newSlice[i] = valueToInterface(f.Index(i), clusterSupportsFloat)
}

return newSlice
return newSlice
}
case reflect.Interface:
if f.IsNil() {
return nil
Expand Down