diff --git a/.golangci.yml b/.golangci.yml index 10ef904d..4e3a4061 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -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 diff --git a/cmd/utils.go b/cmd/utils.go index 902319a9..605020c8 100644 --- a/cmd/utils.go +++ b/cmd/utils.go @@ -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: diff --git a/files/file.go b/files/file.go index 6c985cd6..9f108d11 100644 --- a/files/file.go +++ b/files/file.go @@ -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" diff --git a/files/listing.go b/files/listing.go index bd16afdd..ad60e51e 100644 --- a/files/listing.go +++ b/files/listing.go @@ -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 { diff --git a/http/tus_handlers.go b/http/tus_handlers.go index bd4583cf..7a3254ae 100644 --- a/http/tus_handlers.go +++ b/http/tus_handlers.go @@ -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 } diff --git a/runner/parser.go b/runner/parser.go index 056ff4c8..e1035720 100644 --- a/runner/parser.go +++ b/runner/parser.go @@ -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