Skip to content

Commit

Permalink
Fix the return value problem
Browse files Browse the repository at this point in the history
Signed-off-by: Deathstroke <[email protected]>
  • Loading branch information
Deathstr0ke1 committed May 12, 2024
1 parent 0a0e7cf commit c7cfb3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/encoding/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ func Convert(codecs serializer.CodecFactory, inMediaType, outMediaType string, i
} else if inMediaType == JsonMediaType && outMediaType == YamlMediaType {
val := map[string]interface{}{}
if err := json.Unmarshal(in, &val); err != nil {
return nil, fmt.Errorf("error decoding from %s: %s", inMediaType, err)
return nil, nil, fmt.Errorf("error decoding from %s: %s", inMediaType, err)
}
encoded, err = yaml.Marshal(val)
if err != nil {
return nil, fmt.Errorf("error encoding from %s: %s", outMediaType, err)
return nil, nil, fmt.Errorf("error encoding from %s: %s", outMediaType, err)
}
} else {
inCodec, err := newCodec(codecs, typeMeta, inMediaType)
Expand Down

0 comments on commit c7cfb3d

Please sign in to comment.