build: bump golangci-lint to 2.1.6

This commit is contained in:
Oleksandr Redko
2025-06-26 21:18:20 +03:00
committed by Henrique Dias
parent da03728cd7
commit 1d494ff315
15 changed files with 515 additions and 436 deletions

View File

@@ -56,7 +56,7 @@ The path must be for a json or yaml file.`,
checkErr(err)
var rawAuther interface{}
if filepath.Ext(args[0]) != ".json" { //nolint:goconst
if filepath.Ext(args[0]) != ".json" {
rawAuther = cleanUpInterfaceMap(file.Auther.(map[interface{}]interface{}))
} else {
rawAuther = file.Auther

View File

@@ -61,11 +61,11 @@ func addServerFlags(flags *pflag.FlagSet) {
flags.StringP("key", "k", "", "tls key")
flags.StringP("root", "r", ".", "root to prepend to relative paths")
flags.String("socket", "", "socket to listen to (cannot be used with address, port, cert nor key flags)")
flags.Uint32("socket-perm", 0666, "unix socket file permissions") //nolint:gomnd
flags.Uint32("socket-perm", 0666, "unix socket file permissions") //nolint:mnd
flags.StringP("baseurl", "b", "", "base url")
flags.String("cache-dir", "", "file cache directory (disabled if empty)")
flags.String("token-expiration-time", "2h", "user session timeout")
flags.Int("img-processors", 4, "image processors count") //nolint:gomnd
flags.Int("img-processors", 4, "image processors count") //nolint:mnd
flags.Bool("disable-thumbnails", false, "disable image thumbnails")
flags.Bool("disable-preview-resize", false, "disable resize of image previews")
flags.Bool("disable-exec", true, "disables Command Runner feature")
@@ -129,7 +129,7 @@ user created with the credentials from options "username" and "password".`,
cacheDir, err := cmd.Flags().GetString("cache-dir")
checkErr(err)
if cacheDir != "" {
if err := os.MkdirAll(cacheDir, 0700); err != nil { //nolint:govet,gomnd
if err := os.MkdirAll(cacheDir, 0700); err != nil { //nolint:govet,mnd
log.Fatalf("can't make directory %s: %s", cacheDir, err)
}
fileCache = diskcache.New(afero.NewOsFs(), cacheDir)
@@ -189,7 +189,7 @@ user created with the credentials from options "username" and "password".`,
}, pythonConfig{allowNoDB: true}),
}
func cleanupHandler(listener net.Listener, c chan os.Signal) { //nolint:interfacer
func cleanupHandler(listener net.Listener, c chan os.Signal) {
sig := <-c
log.Printf("Caught signal %s: shutting down.", sig)
listener.Close()

View File

@@ -73,7 +73,7 @@ func dbExists(path string) (bool, error) {
d := filepath.Dir(path)
_, err = os.Stat(d)
if os.IsNotExist(err) {
if err := os.MkdirAll(d, 0700); err != nil { //nolint:govet,gomnd
if err := os.MkdirAll(d, 0700); err != nil { //nolint:govet,mnd
return false, err
}
return false, nil
@@ -121,7 +121,7 @@ func marshal(filename string, data interface{}) error {
defer fd.Close()
switch ext := filepath.Ext(filename); ext {
case ".json":
case ".json": //nolint:goconst
encoder := json.NewEncoder(fd)
encoder.SetIndent("", " ")
return encoder.Encode(data)