aboutsummaryrefslogtreecommitdiff
path: root/internal/markup
diff options
context:
space:
mode:
authordeepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>2022-03-06 16:33:45 +0800
committerGitHub <noreply@github.com>2022-03-06 16:33:45 +0800
commitdeec3516d53e9a9679128ade0556ccc818a67be1 (patch)
treeb5c1c5d55be05a244180ece0b822e7e35dc68f42 /internal/markup
parent65526f84e1d382ac01b7379f40fc56b2660d1074 (diff)
autofix: fix check for empty string (#6804)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Diffstat (limited to 'internal/markup')
-rw-r--r--internal/markup/markup.go4
1 files changed, 2 insertions, 2 deletions
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
}