Skip to content

Commit

Permalink
fix: gofmt errors. (go-gitea#1106)
Browse files Browse the repository at this point in the history
  • Loading branch information
appleboy authored and lunny committed Mar 3, 2017
1 parent 6bdfadf commit 28a5bc3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
4 changes: 2 additions & 2 deletions modules/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func AssignForm(form interface{}, data map[string]interface{}) {
func getRuleBody(field reflect.StructField, prefix string) string {
for _, rule := range strings.Split(field.Tag.Get("binding"), ";") {
if strings.HasPrefix(rule, prefix) {
return rule[len(prefix): len(rule) - 1]
return rule[len(prefix) : len(rule)-1]
}
}
return ""
Expand Down Expand Up @@ -237,7 +237,7 @@ func validate(errs binding.Errors, data map[string]interface{}, f Form, l macaro
}

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

trName := field.Tag.Get("locale")
if len(trName) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion modules/auth/auth_form.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type AuthenticationForm struct {
SkipVerify bool
PAMServiceName string
Oauth2Provider string
Oauth2Key string
Oauth2Key string
Oauth2Secret string
}

Expand Down
12 changes: 7 additions & 5 deletions modules/auth/oauth2/oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@
package oauth2

import (
"code.gitea.io/gitea/modules/setting"
"net/http"
"os"
"path/filepath"

"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"

"github.com/gorilla/sessions"
"github.com/markbates/goth"
"github.com/markbates/goth/gothic"
"net/http"
"os"
"github.com/satori/go.uuid"
"path/filepath"
"github.com/markbates/goth/providers/github"
"github.com/satori/go.uuid"
)

var (
Expand Down
20 changes: 10 additions & 10 deletions modules/markdown/markdown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ func TestRegExp_ShortLinkPattern(t *testing.T) {

func TestRegExp_AnySHA1Pattern(t *testing.T) {
testCases := map[string][]string{
"https://github.com/jquery/jquery/blob/a644101ed04d0beacea864ce805e0c4f86ba1cd1/test/unit/event.js#L2703": []string{
"https://github.com/jquery/jquery/blob/a644101ed04d0beacea864ce805e0c4f86ba1cd1/test/unit/event.js#L2703": {
"https",
"github.com",
"jquery",
Expand All @@ -473,7 +473,7 @@ func TestRegExp_AnySHA1Pattern(t *testing.T) {
"test/unit/event.js",
"L2703",
},
"https://github.com/jquery/jquery/blob/a644101ed04d0beacea864ce805e0c4f86ba1cd1/test/unit/event.js": []string{
"https://github.com/jquery/jquery/blob/a644101ed04d0beacea864ce805e0c4f86ba1cd1/test/unit/event.js": {
"https",
"github.com",
"jquery",
Expand All @@ -483,7 +483,7 @@ func TestRegExp_AnySHA1Pattern(t *testing.T) {
"test/unit/event.js",
"",
},
"https://github.com/jquery/jquery/commit/0705be475092aede1eddae01319ec931fb9c65fc": []string{
"https://github.com/jquery/jquery/commit/0705be475092aede1eddae01319ec931fb9c65fc": {
"https",
"github.com",
"jquery",
Expand All @@ -493,7 +493,7 @@ func TestRegExp_AnySHA1Pattern(t *testing.T) {
"",
"",
},
"https://github.com/jquery/jquery/tree/0705be475092aede1eddae01319ec931fb9c65fc/src": []string{
"https://github.com/jquery/jquery/tree/0705be475092aede1eddae01319ec931fb9c65fc/src": {
"https",
"github.com",
"jquery",
Expand All @@ -503,7 +503,7 @@ func TestRegExp_AnySHA1Pattern(t *testing.T) {
"src",
"",
},
"https://try.gogs.io/gogs/gogs/commit/d8a994ef243349f321568f9e36d5c3f444b99cae#diff-2": []string{
"https://try.gogs.io/gogs/gogs/commit/d8a994ef243349f321568f9e36d5c3f444b99cae#diff-2": {
"https",
"try.gogs.io",
"gogs",
Expand All @@ -522,35 +522,35 @@ func TestRegExp_AnySHA1Pattern(t *testing.T) {

func TestRegExp_IssueFullPattern(t *testing.T) {
testCases := map[string][]string{
"https://github.com/gogits/gogs/pull/3244": []string{
"https://github.com/gogits/gogs/pull/3244": {
"https",
"github.com/gogits/gogs/pull/",
"3244",
"",
"",
},
"https://github.com/gogits/gogs/issues/3247#issuecomment-231517079": []string{
"https://github.com/gogits/gogs/issues/3247#issuecomment-231517079": {
"https",
"github.com/gogits/gogs/issues/",
"3247",
"#issuecomment-231517079",
"",
},
"https://try.gogs.io/gogs/gogs/issues/4#issue-685": []string{
"https://try.gogs.io/gogs/gogs/issues/4#issue-685": {
"https",
"try.gogs.io/gogs/gogs/issues/",
"4",
"#issue-685",
"",
},
"https://youtrack.jetbrains.com/issue/JT-36485": []string{
"https://youtrack.jetbrains.com/issue/JT-36485": {
"https",
"youtrack.jetbrains.com/issue/",
"JT-36485",
"",
"",
},
"https://youtrack.jetbrains.com/issue/JT-36485#comment=27-1508676": []string{
"https://youtrack.jetbrains.com/issue/JT-36485#comment=27-1508676": {
"https",
"youtrack.jetbrains.com/issue/",
"JT-36485",
Expand Down

0 comments on commit 28a5bc3

Please sign in to comment.