Skip to content

Commit

Permalink
Lint: Ignore marshalling warning with reflect.Value
Browse files Browse the repository at this point in the history
pkg/runtime/bindform.go:102:34: SA9005: struct type 'reflect.Value' doesn't have any exported fields, nor custom marshaling (staticcheck)
                                if data, err := json.Marshal(field); err != nil {
  • Loading branch information
Jamie Tanna committed Nov 12, 2022
1 parent 88c9e25 commit 412867b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/runtime/bindform.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func MarshalForm(ptr interface{}, encodings map[string]RequestBodyEncoding) (url
tag = strings.Split(tag, ",")[0] // extract the name of the tag
if encoding, ok := encodings[tag]; ok && encoding.ContentType != "" {
if strings.HasPrefix(encoding.ContentType, jsonContentType) {
if data, err := json.Marshal(field); err != nil {
if data, err := json.Marshal(field); err != nil { //nolint:staticcheck
return nil, err
} else {
result[tag] = append(result[tag], string(data))
Expand Down

0 comments on commit 412867b

Please sign in to comment.