index
:
gogs.git
Gogs is a painless self-hosted Git service
log msg
author
committer
range
buildscript
main
mygogs
about
summary
refs
log
tree
commit
diff
path:
root
/
internal
/
markup
diff options
context:
1
2
3
4
5
6
7
8
9
10
15
20
25
30
35
40
space:
include
ignore
mode:
unified
ssdiff
stat only
author
deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
2022-03-06 16:33:45 +0800
committer
GitHub <noreply@github.com>
2022-03-06 16:33:45 +0800
commit
deec3516d53e9a9679128ade0556ccc818a67be1
(
patch
)
tree
b5c1c5d55be05a244180ece0b822e7e35dc68f42
/
internal/markup
parent
65526f84e1d382ac01b7379f40fc56b2660d1074
(
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.go
4
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
}