From 2ed253d9f2965d4e4014765f08497aeb2ddae982 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Fri, 2 Jun 2023 12:22:00 -0700 Subject: [PATCH] fix(lint): remove naked returns --- utils/utils.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/utils.go b/utils/utils.go index 99d13c312..df37e6a95 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -376,18 +376,18 @@ func DecodeBase64Image(url string) (bytes []byte, extension string, err error) { s := strings.SplitN(url, ",", 2) if len(s) < 2 { err = errors.New("error splitting base64 image data") - return + return nil, "", err } bytes, err = base64.StdEncoding.DecodeString(s[1]) if err != nil { - return + return nil, "", err } splitHeader := strings.Split(s[0], ":") if len(splitHeader) < 2 { err = errors.New("error splitting base64 image header") - return + return nil, "", err } contentType := strings.Split(splitHeader[1], ";")[0] @@ -404,7 +404,7 @@ func DecodeBase64Image(url string) (bytes []byte, extension string, err error) { if extension == "" { err = errors.New("missing or invalid contentType in base64 image") - return + return nil, "", err } return bytes, extension, nil