Permalink
Browse files

accept by value too

  • Loading branch information...
1 parent 1224bac commit 4a1ab5aed6d39ecae8f6ef905c175bbd02611581 @fabiokung committed Aug 31, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 dynamodb.go
View
@@ -104,11 +104,11 @@ func fieldToDynamoString(v reflect.Value) (typeId string, value string, err erro
return "", "", &json.MarshalerError{Type: v.Type()}
}
-func (i *PutRequestItem) MarshalJSON() ([]byte, error) {
+func (i PutRequestItem) MarshalJSON() ([]byte, error) {
var out bytes.Buffer
v := reflect.ValueOf(i.Value)
- if v.Kind() == reflect.Interface || v.Kind() == reflect.Ptr {
+ for v.Kind() == reflect.Interface || v.Kind() == reflect.Ptr {
v = v.Elem()
}

0 comments on commit 4a1ab5a

Please sign in to comment.