1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

format with gofumpt (#18184)

* gofumpt -w -l .

* gofumpt -w -l -extra .

* Add linter

* manual fix

* change make fmt
This commit is contained in:
6543
2022-01-20 18:46:10 +01:00
committed by GitHub
parent 1d98d205f5
commit 54e9ee37a7
423 changed files with 1585 additions and 1758 deletions

View File

@@ -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
}

View File

@@ -11,7 +11,7 @@ import (
)
func TestParseAcceptEncoding(t *testing.T) {
var kases = []struct {
kases := []struct {
Header string
Expected map[string]bool
}{

View File

@@ -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:])
}