aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorBo-Yi Wu <appleboy.tw@gmail.com>2016-12-30 15:26:05 +0800
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2016-12-30 20:41:10 +0100
commit6510e5775896343f0a69c47ad31c439c7310ff34 (patch)
tree875044ba5fcd58a4cc7e7d1b1215f7217963a30d /models
parentd0490c187cf6720ed4d0e8ce14c8706e61adaf1f (diff)
downloadgitea-6510e5775896343f0a69c47ad31c439c7310ff34.tar.gz
gitea-6510e5775896343f0a69c47ad31c439c7310ff34.zip
fix gofmt error
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Diffstat (limited to 'models')
-rw-r--r--models/git_diff_test.go16
-rw-r--r--models/issue.go4
-rw-r--r--models/models.go18
3 files changed, 19 insertions, 19 deletions
diff --git a/models/git_diff_test.go b/models/git_diff_test.go
index cf98f65399..f88e6fb610 100644
--- a/models/git_diff_test.go
+++ b/models/git_diff_test.go
@@ -20,16 +20,16 @@ func assertLineEqual(t *testing.T, d1 *DiffLine, d2 *DiffLine) {
func TestDiffToHTML(t *testing.T) {
assertEqual(t, "+foo <span class=\"added-code\">bar</span> biz", diffToHTML([]dmp.Diff{
- dmp.Diff{dmp.DiffEqual, "foo "},
- dmp.Diff{dmp.DiffInsert, "bar"},
- dmp.Diff{dmp.DiffDelete, " baz"},
- dmp.Diff{dmp.DiffEqual, " biz"},
+ {dmp.DiffEqual, "foo "},
+ {dmp.DiffInsert, "bar"},
+ {dmp.DiffDelete, " baz"},
+ {dmp.DiffEqual, " biz"},
}, DiffLineAdd))
assertEqual(t, "-foo <span class=\"removed-code\">bar</span> biz", diffToHTML([]dmp.Diff{
- dmp.Diff{dmp.DiffEqual, "foo "},
- dmp.Diff{dmp.DiffDelete, "bar"},
- dmp.Diff{dmp.DiffInsert, " baz"},
- dmp.Diff{dmp.DiffEqual, " biz"},
+ {dmp.DiffEqual, "foo "},
+ {dmp.DiffDelete, "bar"},
+ {dmp.DiffInsert, " baz"},
+ {dmp.DiffEqual, " biz"},
}, DiffLineDel))
}
diff --git a/models/issue.go b/models/issue.go
index 6303911808..315c91e159 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -1202,8 +1202,8 @@ func GetIssueStats(opts *IssueStatsOptions) *IssueStats {
if opts.MentionedID > 0 {
sess.Join("INNER", "issue_user", "issue.id = issue_user.issue_id").
- And("issue_user.uid = ?", opts.MentionedID).
- And("issue_user.is_mentioned = ?", true)
+ And("issue_user.uid = ?", opts.MentionedID).
+ And("issue_user.is_mentioned = ?", true)
}
return sess
diff --git a/models/models.go b/models/models.go
index 1bebaa602c..e937580d18 100644
--- a/models/models.go
+++ b/models/models.go
@@ -156,15 +156,15 @@ func parsePostgreSQLHostPort(info string) (string, string) {
func parseMSSQLHostPort(info string) (string, string) {
host, port := "127.0.0.1", "1433"
- if strings.Contains(info, ":") {
- host = strings.Split(info, ":")[0]
- port = strings.Split(info, ":")[1]
- } else if strings.Contains(info, ",") {
- host = strings.Split(info, ",")[0]
- port = strings.TrimSpace(strings.Split(info, ",")[1])
- } else if len(info) > 0 {
- host = info
- }
+ if strings.Contains(info, ":") {
+ host = strings.Split(info, ":")[0]
+ port = strings.Split(info, ":")[1]
+ } else if strings.Contains(info, ",") {
+ host = strings.Split(info, ",")[0]
+ port = strings.TrimSpace(strings.Split(info, ",")[1])
+ } else if len(info) > 0 {
+ host = info
+ }
return host, port
}