ci: remove goconst

This commit is contained in:
Henrique Dias 2025-06-27 08:03:11 +02:00
parent 1d494ff315
commit 8b8fb3343f
No known key found for this signature in database
6 changed files with 5 additions and 11 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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