mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-06-30 05:02:59 +00:00
ci: remove goconst
This commit is contained in:
parent
1d494ff315
commit
8b8fb3343f
@ -13,7 +13,6 @@ linters:
|
|||||||
- funlen
|
- funlen
|
||||||
- gocheckcompilerdirectives
|
- gocheckcompilerdirectives
|
||||||
- gochecknoinits
|
- gochecknoinits
|
||||||
- goconst
|
|
||||||
- gocritic
|
- gocritic
|
||||||
- gocyclo
|
- gocyclo
|
||||||
- godox
|
- godox
|
||||||
@ -43,9 +42,6 @@ linters:
|
|||||||
funlen:
|
funlen:
|
||||||
lines: 100
|
lines: 100
|
||||||
statements: 50
|
statements: 50
|
||||||
goconst:
|
|
||||||
min-len: 2
|
|
||||||
min-occurrences: 2
|
|
||||||
gocritic:
|
gocritic:
|
||||||
disabled-checks:
|
disabled-checks:
|
||||||
- dupImport # https://github.com/go-critic/go-critic/issues/845
|
- dupImport # https://github.com/go-critic/go-critic/issues/845
|
||||||
|
@ -121,11 +121,11 @@ func marshal(filename string, data interface{}) error {
|
|||||||
defer fd.Close()
|
defer fd.Close()
|
||||||
|
|
||||||
switch ext := filepath.Ext(filename); ext {
|
switch ext := filepath.Ext(filename); ext {
|
||||||
case ".json": //nolint:goconst
|
case ".json":
|
||||||
encoder := json.NewEncoder(fd)
|
encoder := json.NewEncoder(fd)
|
||||||
encoder.SetIndent("", " ")
|
encoder.SetIndent("", " ")
|
||||||
return encoder.Encode(data)
|
return encoder.Encode(data)
|
||||||
case ".yml", ".yaml": //nolint:goconst
|
case ".yml", ".yaml":
|
||||||
encoder := yaml.NewEncoder(fd)
|
encoder := yaml.NewEncoder(fd)
|
||||||
return encoder.Encode(data)
|
return encoder.Encode(data)
|
||||||
default:
|
default:
|
||||||
|
@ -217,7 +217,6 @@ func (i *FileInfo) RealPath() string {
|
|||||||
return i.Path
|
return i.Path
|
||||||
}
|
}
|
||||||
|
|
||||||
//nolint:goconst
|
|
||||||
func (i *FileInfo) detectType(modify, saveContent, readHeader bool) error {
|
func (i *FileInfo) detectType(modify, saveContent, readHeader bool) error {
|
||||||
if IsNamedPipe(i.Mode) {
|
if IsNamedPipe(i.Mode) {
|
||||||
i.Type = "blob"
|
i.Type = "blob"
|
||||||
|
@ -16,8 +16,6 @@ type Listing struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ApplySort applies the sort order using .Order and .Sort
|
// ApplySort applies the sort order using .Order and .Sort
|
||||||
//
|
|
||||||
//nolint:goconst
|
|
||||||
func (l Listing) ApplySort() {
|
func (l Listing) ApplySort() {
|
||||||
// Check '.Order' to know how to sort
|
// Check '.Order' to know how to sort
|
||||||
if !l.Sorting.Asc {
|
if !l.Sorting.Asc {
|
||||||
|
@ -41,7 +41,7 @@ func tusPostHandler() handleFunc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fileFlags := os.O_CREATE | os.O_WRONLY
|
fileFlags := os.O_CREATE | os.O_WRONLY
|
||||||
if r.URL.Query().Get("override") == "true" { //nolint:goconst
|
if r.URL.Query().Get("override") == "true" {
|
||||||
fileFlags |= os.O_TRUNC
|
fileFlags |= os.O_TRUNC
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,8 @@ func ParseCommand(s *settings.Settings, raw string) (command []string, name stri
|
|||||||
command = append(command, name)
|
command = append(command, name)
|
||||||
command = append(command, args...)
|
command = append(command, args...)
|
||||||
} else {
|
} else {
|
||||||
command = append(s.Shell, raw) //nolint:gocritic
|
command = append(command, s.Shell...)
|
||||||
|
command = append(command, raw)
|
||||||
}
|
}
|
||||||
|
|
||||||
return command, name, nil
|
return command, name, nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user