mirror of
https://github.com/owncast/owncast.git
synced 2024-11-21 20:28:15 +03:00
fix(lint): remove naked returns
This commit is contained in:
parent
35bdb5bca2
commit
2ed253d9f2
1 changed files with 4 additions and 4 deletions
|
@ -376,18 +376,18 @@ func DecodeBase64Image(url string) (bytes []byte, extension string, err error) {
|
||||||
s := strings.SplitN(url, ",", 2)
|
s := strings.SplitN(url, ",", 2)
|
||||||
if len(s) < 2 {
|
if len(s) < 2 {
|
||||||
err = errors.New("error splitting base64 image data")
|
err = errors.New("error splitting base64 image data")
|
||||||
return
|
return nil, "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
bytes, err = base64.StdEncoding.DecodeString(s[1])
|
bytes, err = base64.StdEncoding.DecodeString(s[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return nil, "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
splitHeader := strings.Split(s[0], ":")
|
splitHeader := strings.Split(s[0], ":")
|
||||||
if len(splitHeader) < 2 {
|
if len(splitHeader) < 2 {
|
||||||
err = errors.New("error splitting base64 image header")
|
err = errors.New("error splitting base64 image header")
|
||||||
return
|
return nil, "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
contentType := strings.Split(splitHeader[1], ";")[0]
|
contentType := strings.Split(splitHeader[1], ";")[0]
|
||||||
|
@ -404,7 +404,7 @@ func DecodeBase64Image(url string) (bytes []byte, extension string, err error) {
|
||||||
|
|
||||||
if extension == "" {
|
if extension == "" {
|
||||||
err = errors.New("missing or invalid contentType in base64 image")
|
err = errors.New("missing or invalid contentType in base64 image")
|
||||||
return
|
return nil, "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
return bytes, extension, nil
|
return bytes, extension, nil
|
||||||
|
|
Loading…
Reference in a new issue