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))
}
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
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
}
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:])
}
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 {
return
}
-
if setting.MailService.UseSendmail {
Sender = &sendmailSender{}
} else {
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=\".\"")
}
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":