Skip to content

Commit 28a5bc3

Browse files
appleboylunny
authored andcommitted
fix: gofmt errors. (#1106)
1 parent 6bdfadf commit 28a5bc3

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

modules/auth/auth.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func AssignForm(form interface{}, data map[string]interface{}) {
179179
func getRuleBody(field reflect.StructField, prefix string) string {
180180
for _, rule := range strings.Split(field.Tag.Get("binding"), ";") {
181181
if strings.HasPrefix(rule, prefix) {
182-
return rule[len(prefix): len(rule) - 1]
182+
return rule[len(prefix) : len(rule)-1]
183183
}
184184
}
185185
return ""
@@ -237,7 +237,7 @@ func validate(errs binding.Errors, data map[string]interface{}, f Form, l macaro
237237
}
238238

239239
if errs[0].FieldNames[0] == field.Name {
240-
data["Err_" + field.Name] = true
240+
data["Err_"+field.Name] = true
241241

242242
trName := field.Tag.Get("locale")
243243
if len(trName) == 0 {

modules/auth/auth_form.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type AuthenticationForm struct {
3737
SkipVerify bool
3838
PAMServiceName string
3939
Oauth2Provider string
40-
Oauth2Key string
40+
Oauth2Key string
4141
Oauth2Secret string
4242
}
4343

modules/auth/oauth2/oauth2.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@
55
package oauth2
66

77
import (
8-
"code.gitea.io/gitea/modules/setting"
8+
"net/http"
9+
"os"
10+
"path/filepath"
11+
912
"code.gitea.io/gitea/modules/log"
13+
"code.gitea.io/gitea/modules/setting"
14+
1015
"github.com/gorilla/sessions"
1116
"github.com/markbates/goth"
1217
"github.com/markbates/goth/gothic"
13-
"net/http"
14-
"os"
15-
"github.com/satori/go.uuid"
16-
"path/filepath"
1718
"github.com/markbates/goth/providers/github"
19+
"github.com/satori/go.uuid"
1820
)
1921

2022
var (

modules/markdown/markdown_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ func TestRegExp_ShortLinkPattern(t *testing.T) {
463463

464464
func TestRegExp_AnySHA1Pattern(t *testing.T) {
465465
testCases := map[string][]string{
466-
"https://github.com/jquery/jquery/blob/a644101ed04d0beacea864ce805e0c4f86ba1cd1/test/unit/event.js#L2703": []string{
466+
"https://github.com/jquery/jquery/blob/a644101ed04d0beacea864ce805e0c4f86ba1cd1/test/unit/event.js#L2703": {
467467
"https",
468468
"github.com",
469469
"jquery",
@@ -473,7 +473,7 @@ func TestRegExp_AnySHA1Pattern(t *testing.T) {
473473
"test/unit/event.js",
474474
"L2703",
475475
},
476-
"https://github.com/jquery/jquery/blob/a644101ed04d0beacea864ce805e0c4f86ba1cd1/test/unit/event.js": []string{
476+
"https://github.com/jquery/jquery/blob/a644101ed04d0beacea864ce805e0c4f86ba1cd1/test/unit/event.js": {
477477
"https",
478478
"github.com",
479479
"jquery",
@@ -483,7 +483,7 @@ func TestRegExp_AnySHA1Pattern(t *testing.T) {
483483
"test/unit/event.js",
484484
"",
485485
},
486-
"https://github.com/jquery/jquery/commit/0705be475092aede1eddae01319ec931fb9c65fc": []string{
486+
"https://github.com/jquery/jquery/commit/0705be475092aede1eddae01319ec931fb9c65fc": {
487487
"https",
488488
"github.com",
489489
"jquery",
@@ -493,7 +493,7 @@ func TestRegExp_AnySHA1Pattern(t *testing.T) {
493493
"",
494494
"",
495495
},
496-
"https://github.com/jquery/jquery/tree/0705be475092aede1eddae01319ec931fb9c65fc/src": []string{
496+
"https://github.com/jquery/jquery/tree/0705be475092aede1eddae01319ec931fb9c65fc/src": {
497497
"https",
498498
"github.com",
499499
"jquery",
@@ -503,7 +503,7 @@ func TestRegExp_AnySHA1Pattern(t *testing.T) {
503503
"src",
504504
"",
505505
},
506-
"https://try.gogs.io/gogs/gogs/commit/d8a994ef243349f321568f9e36d5c3f444b99cae#diff-2": []string{
506+
"https://try.gogs.io/gogs/gogs/commit/d8a994ef243349f321568f9e36d5c3f444b99cae#diff-2": {
507507
"https",
508508
"try.gogs.io",
509509
"gogs",
@@ -522,35 +522,35 @@ func TestRegExp_AnySHA1Pattern(t *testing.T) {
522522

523523
func TestRegExp_IssueFullPattern(t *testing.T) {
524524
testCases := map[string][]string{
525-
"https://github.com/gogits/gogs/pull/3244": []string{
525+
"https://github.com/gogits/gogs/pull/3244": {
526526
"https",
527527
"github.com/gogits/gogs/pull/",
528528
"3244",
529529
"",
530530
"",
531531
},
532-
"https://github.com/gogits/gogs/issues/3247#issuecomment-231517079": []string{
532+
"https://github.com/gogits/gogs/issues/3247#issuecomment-231517079": {
533533
"https",
534534
"github.com/gogits/gogs/issues/",
535535
"3247",
536536
"#issuecomment-231517079",
537537
"",
538538
},
539-
"https://try.gogs.io/gogs/gogs/issues/4#issue-685": []string{
539+
"https://try.gogs.io/gogs/gogs/issues/4#issue-685": {
540540
"https",
541541
"try.gogs.io/gogs/gogs/issues/",
542542
"4",
543543
"#issue-685",
544544
"",
545545
},
546-
"https://youtrack.jetbrains.com/issue/JT-36485": []string{
546+
"https://youtrack.jetbrains.com/issue/JT-36485": {
547547
"https",
548548
"youtrack.jetbrains.com/issue/",
549549
"JT-36485",
550550
"",
551551
"",
552552
},
553-
"https://youtrack.jetbrains.com/issue/JT-36485#comment=27-1508676": []string{
553+
"https://youtrack.jetbrains.com/issue/JT-36485#comment=27-1508676": {
554554
"https",
555555
"youtrack.jetbrains.com/issue/",
556556
"JT-36485",

0 commit comments

Comments
 (0)