Merge pull request #102 from yunify/build-structslice-withstringslice-req

struce slice with string slice req
This commit is contained in:
roger 2018-07-03 23:02:31 +08:00 committed by GitHub
commit 8d9d57803e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -204,6 +204,14 @@ func (b *Builder) parseRequestParams() error {
if fieldValue != nil {
requestParams[tagKey] = *fieldValue
}
case []*string:
dst := make([]string, len(fieldValue))
for i := 0; i < len(fieldValue); i++ {
if fieldValue[i] != nil {
dst[i] = *(fieldValue[i])
}
}
requestParams[tagKey] = strings.Join(dst, ",")
}
}
}