diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2016-11-27 18:14:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-27 18:14:25 +0800 |
commit | 94da47271701401b6959bfd308d6c74fd30b22e2 (patch) | |
tree | 92a6c3298ab198efa04fbe4409d282da44736640 /modules/markdown | |
parent | 0a76d260fa16764ab66bf1623b4cd9e9adfdac27 (diff) | |
download | gitea-94da47271701401b6959bfd308d6c74fd30b22e2.tar.gz gitea-94da47271701401b6959bfd308d6c74fd30b22e2.zip |
Golint fixed for modules/setting (#262)
* golint fixed for modules/setting
* typo fixed and renamed UNIXSOCKET to UnixSocket
Diffstat (limited to 'modules/markdown')
-rw-r--r-- | modules/markdown/markdown.go | 6 | ||||
-rw-r--r-- | modules/markdown/markdown_test.go | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/modules/markdown/markdown.go b/modules/markdown/markdown.go index e46f172d3e..6bf29db07a 100644 --- a/modules/markdown/markdown.go +++ b/modules/markdown/markdown.go @@ -135,7 +135,7 @@ func (r *Renderer) AutoLink(out *bytes.Buffer, link []byte, kind int) { // Since this method could only possibly serve one link at a time, // we do not need to find all. - if bytes.HasPrefix(link, []byte(setting.AppUrl)) { + if bytes.HasPrefix(link, []byte(setting.AppURL)) { m := CommitPattern.Find(link) if m != nil { m = bytes.TrimSpace(m) @@ -225,7 +225,7 @@ func cutoutVerbosePrefix(prefix string) string { if prefix[i] == '/' { count++ } - if count >= 3+setting.AppSubUrlDepth { + if count >= 3+setting.AppSubURLDepth { return prefix[:i] } } @@ -279,7 +279,7 @@ func RenderSpecialLink(rawBytes []byte, urlPrefix string, metas map[string]strin for _, m := range ms { m = m[bytes.Index(m, []byte("@")):] rawBytes = bytes.Replace(rawBytes, m, - []byte(fmt.Sprintf(`<a href="%s/%s">%s</a>`, setting.AppSubUrl, m[1:], m)), -1) + []byte(fmt.Sprintf(`<a href="%s/%s">%s</a>`, setting.AppSubURL, m[1:], m)), -1) } rawBytes = RenderIssueIndexPattern(rawBytes, urlPrefix, metas) diff --git a/modules/markdown/markdown_test.go b/modules/markdown/markdown_test.go index 3fc260bf1f..55496aa6af 100644 --- a/modules/markdown/markdown_test.go +++ b/modules/markdown/markdown_test.go @@ -16,7 +16,7 @@ func TestMarkdown(t *testing.T) { urlPrefix = "/prefix" metas map[string]string = nil ) - setting.AppSubUrlDepth = 0 + setting.AppSubURLDepth = 0 Convey("To the internal issue tracker", func() { Convey("It should not render anything when there are no mentions", func() { @@ -237,7 +237,7 @@ func TestMarkdown(t *testing.T) { }) Convey("Rendering an issue URL", t, func() { - setting.AppUrl = "http://localhost:3000/" + setting.AppURL = "http://localhost:3000/" htmlFlags := 0 htmlFlags |= blackfriday.HTML_SKIP_STYLE htmlFlags |= blackfriday.HTML_OMIT_CONTENTS @@ -279,7 +279,7 @@ func TestMarkdown(t *testing.T) { }) Convey("Rendering a commit URL", t, func() { - setting.AppUrl = "http://localhost:3000/" + setting.AppURL = "http://localhost:3000/" htmlFlags := 0 htmlFlags |= blackfriday.HTML_SKIP_STYLE htmlFlags |= blackfriday.HTML_OMIT_CONTENTS |