Merge pull request #28138 from Luap99/golangci-lint

update golangci-lint to v2.10.1
This commit is contained in:
Jan Rodák
2026-02-25 13:53:59 +01:00
committed by GitHub
6 changed files with 8 additions and 14 deletions

View File

@@ -71,7 +71,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 := 2.9.0
GOLANGCI_LINT_VERSION := 2.10.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

@@ -55,12 +55,9 @@ func ls(_ *cobra.Command, args []string) error {
if err != nil {
return fmt.Errorf("setting up grpc client for podman service: %w", err)
}
if err != nil {
return fmt.Errorf("setting up grpc client for podman service: %w", err)
}
reflectionClient := reflectionv1.NewServerReflectionClient(grpcClient)
if reflectionClient == nil {
return fmt.Errorf("setting up client for reflection grpc service: %w", err)
return errors.New("setting up client for reflection grpc service")
}
info, err := reflectionClient.ServerReflectionInfo(ctx)
if err != nil {

View File

@@ -163,13 +163,13 @@ func (r *Runtime) hostInfo() (*define.HostInfo, error) {
// Could not find a humanize-formatter for time.Duration
var buffer bytes.Buffer
buffer.WriteString(fmt.Sprintf("%.0fh %.0fm %.2fs",
fmt.Fprintf(&buffer, "%.0fh %.0fm %.2fs",
uptime.hours,
math.Mod(uptime.minutes, 60),
math.Mod(uptime.seconds, 60),
))
)
if int64(uptime.hours) > 0 {
buffer.WriteString(fmt.Sprintf(" (Approximately %.2f days)", uptime.hours/24))
fmt.Fprintf(&buffer, " (Approximately %.2f days)", uptime.hours/24)
}
info.Uptime = buffer.String()

View File

@@ -80,7 +80,6 @@ func (r *ConmonOCIRuntime) createRootlessContainer(ctr *Container, restoreOption
var parentMount string
for dir := filepath.Dir(rootPath); ; dir = filepath.Dir(dir) {
if m, found := byMountpoint[dir]; found {
//nolint:staticcheck // false positive?! it claims the value of parentMount is not used but we use it below for the mount
parentMount = dir
for o := range strings.SplitSeq(m.Optional, ",") {
opt := strings.Split(o, ":")

View File

@@ -418,9 +418,7 @@ func (ir *ImageEngine) Build(_ context.Context, containerFiles []string, opts en
if err == nil {
return report, nil
}
if err != nil {
logrus.Debugf("BuildLocal failed: %v", err)
}
logrus.Debugf("BuildLocal failed: %v", err)
var errModel *errorhandling.ErrorModel
if errors.As(err, &errModel) {

View File

@@ -1144,7 +1144,7 @@ func ConvertVolume(volume *parser.UnitFile, unitsInfoMap map[string]*UnitInfo, i
if opts.Len() > 2 {
opts.WriteString(",")
}
opts.WriteString(fmt.Sprintf("uid=%d", uid))
fmt.Fprintf(&opts, "uid=%d", uid)
}
if volume.HasKey(VolumeGroup, "Group") {
@@ -1152,7 +1152,7 @@ func ConvertVolume(volume *parser.UnitFile, unitsInfoMap map[string]*UnitInfo, i
if opts.Len() > 2 {
opts.WriteString(",")
}
opts.WriteString(fmt.Sprintf("gid=%d", gid))
fmt.Fprintf(&opts, "gid=%d", gid)
}
copy, ok := volume.LookupBoolean(VolumeGroup, KeyCopy)