]> source.dussan.org Git - gitea.git/commitdiff
fix gofmt error
authorBo-Yi Wu <appleboy.tw@gmail.com>
Fri, 30 Dec 2016 07:26:05 +0000 (15:26 +0800)
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>
Fri, 30 Dec 2016 19:41:10 +0000 (20:41 +0100)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
models/git_diff_test.go
models/issue.go
models/models.go
modules/lfs/content_store.go
modules/mailer/mailer.go
routers/repo/http.go
routers/repo/issue.go

index cf98f653998819931b07360600f1f3301dac8947..f88e6fb6104bb1f5921f599226cc9b53273c198b 100644 (file)
@@ -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))
 }
index 6303911808ff88959603f18c561d841ba1c044ea..315c91e159c41d11e78d2f99a1f3ef85ef4c23bf 100644 (file)
@@ -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
index 1bebaa602cbff50beae10b1a93064d74c532e958..e937580d18dea7e1a0953b861174f211e3faa2e3 100644 (file)
@@ -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
 }
 
index 2ca44512f19899649d77b45a083a5fc58539bd49..7a1f1b44b5ee898891528b74e90cd0bfebb82743 100644 (file)
@@ -90,5 +90,5 @@ func transformKey(key string) string {
                return key
        }
 
-       return filepath.Join(key[0:2], key[2:4], key[4:len(key)])
+       return filepath.Join(key[0:2], key[2:4], key[4:])
 }
index 3201075f3fa75cc517d11bceedcfb32e7f3dfb1a..fd1a5db14f4c7206dde68c543d3151f7785629c0 100644 (file)
@@ -220,12 +220,12 @@ func (s *sendmailSender) Send(from string, to []string, msg io.WriterTo) error {
                return err
        }
 
-       _,err = msg.WriteTo(pipe)
+       _, err = msg.WriteTo(pipe)
 
        // we MUST close the pipe or sendmail will hang waiting for more of the message
        // Also we should wait on our sendmail command even if something fails
        closeError = pipe.Close()
-       waitError =  cmd.Wait()
+       waitError = cmd.Wait()
        if err != nil {
                return err
        } else if closeError != nil {
@@ -263,7 +263,6 @@ func NewContext() {
                return
        }
 
-
        if setting.MailService.UseSendmail {
                Sender = &sendmailSender{}
        } else {
index 6b4dec8149073612bc143783e6a183a379402eb1..695e758cdbc6ee75cff0445ca1268bcb2aef38c3 100644 (file)
@@ -94,7 +94,7 @@ func HTTP(ctx *context.Context) {
                                ctx.HandleText(401, "reverse proxy login error, got error while running GetUserByName")
                                return
                        }
-               }else{
+               } else {
                        authHead := ctx.Req.Header.Get("Authorization")
                        if len(authHead) == 0 {
                                ctx.Resp.Header().Set("WWW-Authenticate", "Basic realm=\".\"")
index 049eac06c310f4217aa407d74266af2aa39a9401..edc6219d3373afe5eccb179c8356825422384276 100644 (file)
@@ -132,10 +132,10 @@ func Issues(ctx *context.Context) {
        }
 
        var (
-               assigneeID = ctx.QueryInt64("assignee")
-               posterID     int64
-               mentionedID  int64
-               forceEmpty   bool
+               assigneeID  = ctx.QueryInt64("assignee")
+               posterID    int64
+               mentionedID int64
+               forceEmpty  bool
        )
        switch viewType {
        case "assigned":