Skip to content

Commit

Permalink
fix acs_request.go map in struct request
Browse files Browse the repository at this point in the history
  • Loading branch information
King-Hell authored and JacksonTian committed Sep 27, 2023
1 parent bdc156f commit f90e3bf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sdk/requests/acs_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,17 @@ func handleStruct(request AcsRequest, dataValue reflect.Value, prefix, name, fie
if err != nil {
return
}
} else if elementValue.Type().Kind().String() == "map" {
iter := elementValue.MapRange()
for iter.Next() {
k := iter.Key()
v := iter.Value()
key = fmt.Sprintf("%s%s.%s.#%d#%s", prefix, name, fieldName, k.Len(), k.String())
err = handleParam(request, v, prefix, key, fieldPosition)
if err != nil {
return
}
}
} else if !elementValue.IsNil() {
repeatedFieldValue := elementValue.Elem()
if repeatedFieldValue.IsValid() && !repeatedFieldValue.IsNil() {
Expand Down

0 comments on commit f90e3bf

Please sign in to comment.