Skip to content

Commit 6510e57

Browse files
appleboybkcsoft
authored andcommitted
fix gofmt error
Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent d0490c1 commit 6510e57

File tree

7 files changed

+27
-28
lines changed

7 files changed

+27
-28
lines changed

models/git_diff_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ func assertLineEqual(t *testing.T, d1 *DiffLine, d2 *DiffLine) {
2020

2121
func TestDiffToHTML(t *testing.T) {
2222
assertEqual(t, "+foo <span class=\"added-code\">bar</span> biz", diffToHTML([]dmp.Diff{
23-
dmp.Diff{dmp.DiffEqual, "foo "},
24-
dmp.Diff{dmp.DiffInsert, "bar"},
25-
dmp.Diff{dmp.DiffDelete, " baz"},
26-
dmp.Diff{dmp.DiffEqual, " biz"},
23+
{dmp.DiffEqual, "foo "},
24+
{dmp.DiffInsert, "bar"},
25+
{dmp.DiffDelete, " baz"},
26+
{dmp.DiffEqual, " biz"},
2727
}, DiffLineAdd))
2828

2929
assertEqual(t, "-foo <span class=\"removed-code\">bar</span> biz", diffToHTML([]dmp.Diff{
30-
dmp.Diff{dmp.DiffEqual, "foo "},
31-
dmp.Diff{dmp.DiffDelete, "bar"},
32-
dmp.Diff{dmp.DiffInsert, " baz"},
33-
dmp.Diff{dmp.DiffEqual, " biz"},
30+
{dmp.DiffEqual, "foo "},
31+
{dmp.DiffDelete, "bar"},
32+
{dmp.DiffInsert, " baz"},
33+
{dmp.DiffEqual, " biz"},
3434
}, DiffLineDel))
3535
}

models/issue.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,8 +1202,8 @@ func GetIssueStats(opts *IssueStatsOptions) *IssueStats {
12021202

12031203
if opts.MentionedID > 0 {
12041204
sess.Join("INNER", "issue_user", "issue.id = issue_user.issue_id").
1205-
And("issue_user.uid = ?", opts.MentionedID).
1206-
And("issue_user.is_mentioned = ?", true)
1205+
And("issue_user.uid = ?", opts.MentionedID).
1206+
And("issue_user.is_mentioned = ?", true)
12071207
}
12081208

12091209
return sess

models/models.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,15 @@ func parsePostgreSQLHostPort(info string) (string, string) {
156156

157157
func parseMSSQLHostPort(info string) (string, string) {
158158
host, port := "127.0.0.1", "1433"
159-
if strings.Contains(info, ":") {
160-
host = strings.Split(info, ":")[0]
161-
port = strings.Split(info, ":")[1]
162-
} else if strings.Contains(info, ",") {
163-
host = strings.Split(info, ",")[0]
164-
port = strings.TrimSpace(strings.Split(info, ",")[1])
165-
} else if len(info) > 0 {
166-
host = info
167-
}
159+
if strings.Contains(info, ":") {
160+
host = strings.Split(info, ":")[0]
161+
port = strings.Split(info, ":")[1]
162+
} else if strings.Contains(info, ",") {
163+
host = strings.Split(info, ",")[0]
164+
port = strings.TrimSpace(strings.Split(info, ",")[1])
165+
} else if len(info) > 0 {
166+
host = info
167+
}
168168
return host, port
169169
}
170170

modules/lfs/content_store.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,5 @@ func transformKey(key string) string {
9090
return key
9191
}
9292

93-
return filepath.Join(key[0:2], key[2:4], key[4:len(key)])
93+
return filepath.Join(key[0:2], key[2:4], key[4:])
9494
}

modules/mailer/mailer.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,12 @@ func (s *sendmailSender) Send(from string, to []string, msg io.WriterTo) error {
220220
return err
221221
}
222222

223-
_,err = msg.WriteTo(pipe)
223+
_, err = msg.WriteTo(pipe)
224224

225225
// we MUST close the pipe or sendmail will hang waiting for more of the message
226226
// Also we should wait on our sendmail command even if something fails
227227
closeError = pipe.Close()
228-
waitError = cmd.Wait()
228+
waitError = cmd.Wait()
229229
if err != nil {
230230
return err
231231
} else if closeError != nil {
@@ -263,7 +263,6 @@ func NewContext() {
263263
return
264264
}
265265

266-
267266
if setting.MailService.UseSendmail {
268267
Sender = &sendmailSender{}
269268
} else {

routers/repo/http.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func HTTP(ctx *context.Context) {
9494
ctx.HandleText(401, "reverse proxy login error, got error while running GetUserByName")
9595
return
9696
}
97-
}else{
97+
} else {
9898
authHead := ctx.Req.Header.Get("Authorization")
9999
if len(authHead) == 0 {
100100
ctx.Resp.Header().Set("WWW-Authenticate", "Basic realm=\".\"")

routers/repo/issue.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ func Issues(ctx *context.Context) {
132132
}
133133

134134
var (
135-
assigneeID = ctx.QueryInt64("assignee")
136-
posterID int64
137-
mentionedID int64
138-
forceEmpty bool
135+
assigneeID = ctx.QueryInt64("assignee")
136+
posterID int64
137+
mentionedID int64
138+
forceEmpty bool
139139
)
140140
switch viewType {
141141
case "assigned":

0 commit comments

Comments
 (0)