Skip to content

Commit

Permalink
fixup: combine multipe IFs in parseMediaType method
Browse files Browse the repository at this point in the history
  • Loading branch information
vadzappa committed Oct 17, 2023
1 parent 2840b63 commit 9ebf13f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions part.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,7 @@ func (p *Part) decodeContent(r io.Reader, readPartErrorPolicy ReadPartErrorPolic

// parses media type using custom or default media type parser
func (p *Part) parseMediaType(ctype string) (mtype string, params map[string]string, invalidParams []string, err error) {
if p.parser == nil {
return ParseMediaType(ctype)
}

if p.parser.customParseMediaType == nil {
if p.parser == nil || p.parser.customParseMediaType == nil {
return ParseMediaType(ctype)
}

Expand Down

0 comments on commit 9ebf13f

Please sign in to comment.