bugfix type error in multipart-form payload#1863
Conversation
raphael
left a comment
There was a problem hiding this comment.
Thank you for the detailed report and the great PR! I left a couple of comments that would be good to address. Thanks again.
goagen/gen_app/writers.go
Outdated
| case design.NumberKind: | ||
| return "ParseFloat" | ||
| } | ||
| panic("undefined strconv function") |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
goagen/gen_app/writers.go
Outdated
| return a.Type.(*design.Array).ElemType | ||
| } | ||
|
|
||
| func valueTypeOf(pr string, att *design.AttributeDefinition) string { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| return varName + ", (error)(nil)" | ||
| case design.ArrayKind: | ||
| case design.HashKind: | ||
| return valueTypeOf("", att) + "{}, (error)(nil)" |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| return varName + ", (error)(nil)" | ||
| case design.ArrayKind: | ||
| case design.HashKind: | ||
| return valueTypeOf("", att) + "{}, (error)(nil)" |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| case design.HashKind: | ||
| return valueTypeOf("", att) + "{}, (error)(nil)" | ||
| } | ||
| return "(" + valueTypeOf("", att) + ")(nil), (error)(nil)" |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
Thank you, definitely an improvement compared to the original code! |
|
One last request please, could you port this fix to master as well? (cherry-pick the merge commit). |
* bugfix type error in multipart-form payload * bugfix Array attribute error in multipartform * fix wrong comment line and add comment to new function * fix fromString func to do not cause panic and support some other types for array element
|
@raphael |
* bugfix type error in multipart-form payload * bugfix Array attribute error in multipartform * fix wrong comment line and add comment to new function * fix fromString func to do not cause panic and support some other types for array element
bugfix for #1862
type errors occur when set MultipartForm flag