diff options
author | 6543 <6543@obermui.de> | 2022-01-20 18:46:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-20 18:46:10 +0100 |
commit | 54e9ee37a7a301dbe74d46fd3c87712e6120e9bf (patch) | |
tree | 1be12fb072625c1b896b9d72f7912b018aad502b /routers/web/admin | |
parent | 1d98d205f5825f40110e6628b61a97c91ac7f72d (diff) | |
download | gitea-54e9ee37a7a301dbe74d46fd3c87712e6120e9bf.tar.gz gitea-54e9ee37a7a301dbe74d46fd3c87712e6120e9bf.zip |
format with gofumpt (#18184)
* gofumpt -w -l .
* gofumpt -w -l -extra .
* Add linter
* manual fix
* change make fmt
Diffstat (limited to 'routers/web/admin')
-rw-r--r-- | routers/web/admin/admin.go | 2 | ||||
-rw-r--r-- | routers/web/admin/admin_test.go | 2 | ||||
-rw-r--r-- | routers/web/admin/emails.go | 5 | ||||
-rw-r--r-- | routers/web/admin/users_test.go | 1 |
4 files changed, 3 insertions, 7 deletions
diff --git a/routers/web/admin/admin.go b/routers/web/admin/admin.go index 7e25f96ee0..276e1939ad 100644 --- a/routers/web/admin/admin.go +++ b/routers/web/admin/admin.go @@ -209,7 +209,7 @@ func shadowPassword(provider, cfgItem string) string { case "redis": return shadowPasswordKV(cfgItem, ",") case "mysql": - //root:@tcp(localhost:3306)/macaron?charset=utf8 + // root:@tcp(localhost:3306)/macaron?charset=utf8 atIdx := strings.Index(cfgItem, "@") if atIdx > 0 { colonIdx := strings.Index(cfgItem[:atIdx], ":") diff --git a/routers/web/admin/admin_test.go b/routers/web/admin/admin_test.go index da404e50d7..1bc43998b2 100644 --- a/routers/web/admin/admin_test.go +++ b/routers/web/admin/admin_test.go @@ -11,7 +11,7 @@ import ( ) func TestShadowPassword(t *testing.T) { - var kases = []struct { + kases := []struct { Provider string CfgItem string Result string diff --git a/routers/web/admin/emails.go b/routers/web/admin/emails.go index cbf0ec5e98..b94f9d72c4 100644 --- a/routers/web/admin/emails.go +++ b/routers/web/admin/emails.go @@ -101,9 +101,7 @@ func Emails(ctx *context.Context) { ctx.HTML(http.StatusOK, tplEmails) } -var ( - nullByte = []byte{0x00} -) +var nullByte = []byte{0x00} func isKeywordValid(keyword string) bool { return !bytes.Contains([]byte(keyword), nullByte) @@ -111,7 +109,6 @@ func isKeywordValid(keyword string) bool { // ActivateEmail serves a POST request for activating/deactivating a user's email func ActivateEmail(ctx *context.Context) { - truefalse := map[string]bool{"1": true, "0": false} uid := ctx.FormInt64("uid") diff --git a/routers/web/admin/users_test.go b/routers/web/admin/users_test.go index 1849781bc4..46133688a5 100644 --- a/routers/web/admin/users_test.go +++ b/routers/web/admin/users_test.go @@ -19,7 +19,6 @@ import ( ) func TestNewUserPost_MustChangePassword(t *testing.T) { - unittest.PrepareTestEnv(t) ctx := test.MockContext(t, "admin/users/new") |