From deec3516d53e9a9679128ade0556ccc818a67be1 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Sun, 6 Mar 2022 16:33:45 +0800 Subject: autofix: fix check for empty string (#6804) Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> --- internal/markup/markup.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/markup') diff --git a/internal/markup/markup.go b/internal/markup/markup.go index b542f63d..fbcab4f3 100644 --- a/internal/markup/markup.go +++ b/internal/markup/markup.go @@ -70,7 +70,7 @@ func FindAllMentions(content string) []string { // cutoutVerbosePrefix cutouts URL prefix including sub-path to // return a clean unified string of request URL path. func cutoutVerbosePrefix(prefix string) string { - if len(prefix) == 0 || prefix[0] != '/' { + if prefix == "" || prefix[0] != '/' { return prefix } count := 0 @@ -186,7 +186,7 @@ func wrapImgWithLink(urlPrefix string, buf *bytes.Buffer, token html.Token) { } // Skip in case the "src" is empty - if len(src) == 0 { + if src == "" { buf.WriteString(token.String()) return } -- cgit v1.2.3