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
|
||||
- gocheckcompilerdirectives
|
||||
- gochecknoinits
|
||||
- goconst
|
||||
- gocritic
|
||||
- gocyclo
|
||||
- godox
|
||||
@ -43,9 +42,6 @@ linters:
|
||||
funlen:
|
||||
lines: 100
|
||||
statements: 50
|
||||
goconst:
|
||||
min-len: 2
|
||||
min-occurrences: 2
|
||||
gocritic:
|
||||
disabled-checks:
|
||||
- dupImport # https://github.com/go-critic/go-critic/issues/845
|
||||
|
@ -121,11 +121,11 @@ func marshal(filename string, data interface{}) error {
|
||||
defer fd.Close()
|
||||
|
||||
switch ext := filepath.Ext(filename); ext {
|
||||
case ".json": //nolint:goconst
|
||||
case ".json":
|
||||
encoder := json.NewEncoder(fd)
|
||||
encoder.SetIndent("", " ")
|
||||
return encoder.Encode(data)
|
||||
case ".yml", ".yaml": //nolint:goconst
|
||||
case ".yml", ".yaml":
|
||||
encoder := yaml.NewEncoder(fd)
|
||||
return encoder.Encode(data)
|
||||
default:
|
||||
|
@ -217,7 +217,6 @@ func (i *FileInfo) RealPath() string {
|
||||
return i.Path
|
||||
}
|
||||
|
||||
//nolint:goconst
|
||||
func (i *FileInfo) detectType(modify, saveContent, readHeader bool) error {
|
||||
if IsNamedPipe(i.Mode) {
|
||||
i.Type = "blob"
|
||||
|
@ -16,8 +16,6 @@ type Listing struct {
|
||||
}
|
||||
|
||||
// ApplySort applies the sort order using .Order and .Sort
|
||||
//
|
||||
//nolint:goconst
|
||||
func (l Listing) ApplySort() {
|
||||
// Check '.Order' to know how to sort
|
||||
if !l.Sorting.Asc {
|
||||
|
@ -41,7 +41,7 @@ func tusPostHandler() handleFunc {
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,8 @@ func ParseCommand(s *settings.Settings, raw string) (command []string, name stri
|
||||
command = append(command, name)
|
||||
command = append(command, args...)
|
||||
} else {
|
||||
command = append(s.Shell, raw) //nolint:gocritic
|
||||
command = append(command, s.Shell...)
|
||||
command = append(command, raw)
|
||||
}
|
||||
|
||||
return command, name, nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user