summaryrefslogtreecommitdiffstats
path: root/modules/public
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2022-01-20 18:46:10 +0100
committerGitHub <noreply@github.com>2022-01-20 18:46:10 +0100
commit54e9ee37a7a301dbe74d46fd3c87712e6120e9bf (patch)
tree1be12fb072625c1b896b9d72f7912b018aad502b /modules/public
parent1d98d205f5825f40110e6628b61a97c91ac7f72d (diff)
downloadgitea-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 'modules/public')
-rw-r--r--modules/public/public.go4
-rw-r--r--modules/public/public_test.go2
-rw-r--r--modules/public/static.go2
3 files changed, 4 insertions, 4 deletions
diff --git a/modules/public/public.go b/modules/public/public.go
index f4a769f27a..91ecf42a3c 100644
--- a/modules/public/public.go
+++ b/modules/public/public.go
@@ -28,7 +28,7 @@ const AssetsURLPathPrefix = "/assets/"
// AssetsHandlerFunc implements the static handler for serving custom or original assets.
func AssetsHandlerFunc(opts *Options) http.HandlerFunc {
- var custPath = filepath.Join(setting.CustomPath, "public")
+ custPath := filepath.Join(setting.CustomPath, "public")
if !filepath.IsAbs(custPath) {
custPath = filepath.Join(setting.AppWorkPath, custPath)
}
@@ -85,7 +85,7 @@ func AssetsHandlerFunc(opts *Options) http.HandlerFunc {
// parseAcceptEncoding parse Accept-Encoding: deflate, gzip;q=1.0, *;q=0.5 as compress methods
func parseAcceptEncoding(val string) map[string]bool {
parts := strings.Split(val, ";")
- var types = make(map[string]bool)
+ types := make(map[string]bool)
for _, v := range strings.Split(parts[0], ",") {
types[strings.TrimSpace(v)] = true
}
diff --git a/modules/public/public_test.go b/modules/public/public_test.go
index cf8dced431..430e734564 100644
--- a/modules/public/public_test.go
+++ b/modules/public/public_test.go
@@ -11,7 +11,7 @@ import (
)
func TestParseAcceptEncoding(t *testing.T) {
- var kases = []struct {
+ kases := []struct {
Header string
Expected map[string]bool
}{
diff --git a/modules/public/static.go b/modules/public/static.go
index a81efacfa4..d373c712ee 100644
--- a/modules/public/static.go
+++ b/modules/public/static.go
@@ -41,7 +41,7 @@ func Asset(name string) ([]byte, error) {
func AssetNames() []string {
realFS := Assets.(vfsgen۰FS)
- var results = make([]string, 0, len(realFS))
+ results := make([]string, 0, len(realFS))
for k := range realFS {
results = append(results, k[1:])
}