Merge pull request #23614 from Luap99/lint-1.60.1

update golangci-lint to 1.60.1
This commit is contained in:
openshift-merge-bot[bot] 2024-08-19 11:19:06 +00:00 committed by GitHub
commit 84126fdba1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
317 changed files with 601 additions and 361 deletions

View File

@ -62,7 +62,7 @@ BUILDTAGS += ${EXTRA_BUILDTAGS}
# N/B: This value is managed by Renovate, manual changes are
# possible, as long as they don't disturb the formatting
# (i.e. DO NOT ADD A 'v' prefix!)
GOLANGCI_LINT_VERSION := 1.59.1
GOLANGCI_LINT_VERSION := 1.60.1
PYTHON ?= $(shell command -v python3 python|head -n1)
PKG_MANAGER ?= $(shell command -v dnf yum|head -n1)
# ~/.local/bin is not in PATH on all systems

View File

@ -1,3 +1,5 @@
//go:build !remote
package main
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package main
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package main
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package main
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package main
import (

View File

@ -1,5 +1,4 @@
//go:build linux && !remote
// +build linux,!remote
package main

View File

@ -1,16 +0,0 @@
//go:build !linux || remote
// +build !linux remote
package main
import "github.com/containers/podman/v5/pkg/domain/entities"
const engineMode = entities.TunnelMode
func storeBefore() error {
return nil
}
func storeAfter() error {
return nil
}

View File

@ -9,7 +9,6 @@ import (
"github.com/containers/common/pkg/completion"
"github.com/containers/podman/v5/cmd/podman/common"
"github.com/containers/podman/v5/cmd/podman/registry"
"github.com/containers/podman/v5/pkg/api/handlers"
"github.com/containers/podman/v5/pkg/domain/entities"
"github.com/spf13/cobra"
)
@ -105,9 +104,6 @@ func commit(cmd *cobra.Command, args []string) error {
if !commitOptions.Quiet {
commitOptions.Writer = os.Stderr
}
if len(commitOptions.Changes) > 0 {
commitOptions.Changes = handlers.DecodeChanges(commitOptions.Changes)
}
if len(configFile) > 0 {
cfg, err := os.ReadFile(configFile)
if err != nil {

View File

@ -314,7 +314,7 @@ func CreateInit(c *cobra.Command, vals entities.ContainerCreateOptions, isInfra
vals.ShmSizeSystemd = c.Flag("shm-size-systemd").Value.String()
}
if (c.Flag("dns").Changed || c.Flag("dns-option").Changed || c.Flag("dns-search").Changed) && vals.Net != nil && (vals.Net.Network.NSMode == specgen.NoNetwork || vals.Net.Network.IsContainer()) {
return vals, fmt.Errorf("conflicting options: dns and the network mode: " + string(vals.Net.Network.NSMode))
return vals, errors.New("conflicting options: dns and the network mode: " + string(vals.Net.Network.NSMode))
}
noHosts, err := c.Flags().GetBool("no-hosts")
if err != nil {

View File

@ -18,11 +18,11 @@ BUILD_TAGS_TUNNEL="$BUILD_TAGS_DEFAULT,remote"
BUILD_TAGS_REMOTE="remote,containers_image_openpgp"
SKIP_DIRS_ABI=""
SKIP_DIRS_TUNNEL="pkg/api,pkg/domain/infra/abi,internal/domain/infra/abi"
SKIP_DIRS_REMOTE="libpod/events,pkg/api,pkg/domain/infra/abi,internal/domain/infra/abi,pkg/machine/qemu,pkg/trust,test"
SKIP_DIRS_TUNNEL=""
SKIP_DIRS_REMOTE="libpod/events,pkg/machine/qemu,pkg/machine/wsl,test"
declare -a to_lint
to_lint=(ABI TUNNEL REMOTE)
to_lint=(ABI TUNNEL)
# Special-case, for Darwin and Windows only "remote" linting is possible and required.
if [[ "$GOOS" == "windows" ]] || [[ "$GOOS" == "darwin" ]]; then

View File

@ -1,3 +1,5 @@
//go:build !remote
package entities
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package entities
type CreateStorageLayerOptions struct {

View File

@ -1,3 +1,5 @@
//go:build !remote
package abi
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package abi
import "github.com/containers/podman/v5/internal/domain/entities"

View File

@ -1,25 +0,0 @@
//go:build remote
package infra
import (
"context"
"fmt"
ientities "github.com/containers/podman/v5/internal/domain/entities"
"github.com/containers/podman/v5/internal/domain/infra/tunnel"
"github.com/containers/podman/v5/pkg/bindings"
"github.com/containers/podman/v5/pkg/domain/entities"
)
// NewTestingEngine factory provides a libpod runtime for testing-specific operations
func NewTestingEngine(facts *entities.PodmanConfig) (ientities.TestingEngine, error) {
switch facts.EngineMode {
case entities.ABIMode:
return nil, fmt.Errorf("direct image runtime not supported")
case entities.TunnelMode:
ctx, err := bindings.NewConnectionWithIdentity(context.Background(), facts.URI, facts.Identity, facts.MachineMode)
return &tunnel.TestingEngine{ClientCtx: ctx}, err
}
return nil, fmt.Errorf("runtime mode '%v' is not supported", facts.EngineMode)
}

View File

@ -1,3 +1,5 @@
//go:build !remote
package tunnel
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package tunnel
import "github.com/containers/podman/v5/internal/domain/entities"

View File

@ -411,7 +411,7 @@ func (c *Container) execPSinContainer(args []string) ([]string, error) {
if logrus.GetLevel() >= logrus.DebugLevel {
// If we're running in debug mode or higher, we might want to have a
// look at stderr which includes debug logs from conmon.
logrus.Debugf(errBuf.String())
logrus.Debug(errBuf.String())
}
if err := <-outErrChan; err != nil {

View File

@ -1,3 +1,5 @@
//go:build linux || freebsd
package events
import (

View File

@ -1,6 +1,7 @@
package annotations
import (
"errors"
"fmt"
"regexp"
"strings"
@ -41,7 +42,7 @@ func isDNS1123Subdomain(value string) error {
}
if !dns1123SubdomainRegexp.MatchString(value) {
return fmt.Errorf(regexErrorMsg(dns1123SubdomainErrorMsg, dns1123SubdomainFmt, "example.com"))
return errors.New(regexErrorMsg(dns1123SubdomainErrorMsg, dns1123SubdomainFmt, "example.com"))
}
return nil

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (
@ -137,7 +139,7 @@ func CommitContainer(w http.ResponseWriter, r *http.Request) {
options.Author = query.Author
options.Pause = query.Pause
options.Squash = query.Squash
options.Changes = handlers.DecodeChanges(query.Changes)
options.Changes = util.DecodeChanges(query.Changes)
if r.Body != nil {
defer r.Body.Close()
if options.CommitOptions.OverrideConfig, err = abi.DecodeOverrideConfig(r.Body); err != nil {

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package compat
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package handlers
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package libpod
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package libpod
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package libpod
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package libpod
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package libpod
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package libpod
import (
@ -499,7 +501,7 @@ func CommitContainer(w http.ResponseWriter, r *http.Request) {
options.Author = query.Author
options.Pause = query.Pause
options.Squash = query.Squash
options.Changes = handlers.DecodeChanges(query.Changes)
options.Changes = util.DecodeChanges(query.Changes)
ctr, err := runtime.LookupContainer(query.Container)
if err != nil {
utils.Error(w, http.StatusNotFound, err)

View File

@ -1,3 +1,5 @@
//go:build !remote
package libpod
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package libpod
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package libpod
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package libpod
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package libpod
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package libpod
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package libpod
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package libpod
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package libpod
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package libpod
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package libpod
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package libpod
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
// Package swagger defines the payloads used by the Podman API
//
// - errors.go: declares the errors used in the API. By embedding errors.ErrorModel, more meaningful

View File

@ -1,3 +1,5 @@
//go:build !remote
//nolint:unused // these types are used to wire generated swagger to API code
package swagger

View File

@ -1,3 +1,5 @@
//go:build !remote
//nolint:unused // these types are used to wire generated swagger to API code
package swagger

View File

@ -1,3 +1,5 @@
//go:build !remote
//nolint:unused // these types are used to wire generated swagger to API code
package swagger

View File

@ -1,3 +1,5 @@
//go:build !remote
package apiutil
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package apiutil
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package utils
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package utils
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package utils
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package utils
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package utils
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
// Package server supports a RESTful API for the Libpod library
//
// This documentation describes the Podman v2.x+ RESTful API. It consists of a Docker-compatible

View File

@ -1,3 +1,5 @@
//go:build !remote
package server
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package server
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package server
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package server
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package idle
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package server
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package server
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package server
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package server
import (

View File

@ -1,3 +1,5 @@
//go:build !remote
package server
import (

Some files were not shown because too many files have changed in this diff Show More