Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
464 changes: 234 additions & 230 deletions .golangci.yml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@ FROM binary-dummy AS containerd-windows
FROM containerd-${TARGETOS} AS containerd

FROM base AS golangci_lint
ARG GOLANGCI_LINT_VERSION=v1.64.5
ARG GOLANGCI_LINT_VERSION=v2.1.5
Comment thread
mmorel-35 marked this conversation as resolved.
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
GOBIN=/build/ GO111MODULE=on go install "github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}" \
GOBIN=/build/ GO111MODULE=on go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}" \
&& /build/golangci-lint --version

FROM base AS gotestsum
Expand Down
17 changes: 10 additions & 7 deletions daemon/logger/journald/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,18 @@ func getPriority(d map[string]string) (journal.Priority, bool) {
// journal priority field back to the stream that we would have assigned that
// value.
func getSource(d map[string]string) string {
source := ""
if priority, ok := getPriority(d); ok {
if priority == journal.PriErr {
source = "stderr"
} else if priority == journal.PriInfo {
source = "stdout"
priority, ok := getPriority(d)
if ok {
switch priority {
case journal.PriErr:
return "stderr"
case journal.PriInfo:
return "stdout"
default:
return ""
}
}
return source
return ""
}

func getAttrs(d map[string]string) []backend.LogAttr {
Expand Down
1 change: 0 additions & 1 deletion daemon/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ var (
func (daemon *Daemon) startIngressWorker() {
ingressJobsChannel = make(chan *ingressJob, 100)
go func() {
//nolint: gosimple
for {
select {
case r := <-ingressJobsChannel:
Expand Down
2 changes: 0 additions & 2 deletions daemon/top_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import (
// NOTE: \\s does not detect unicode whitespaces.
// So we use fieldsASCII instead of strings.Fields in parsePSOutput.
// See https://github.com/docker/docker/pull/24358
//
//nolint:gosimple
var psArgsRegexp = lazyregexp.New("\\s+([^\\s]*)=\\s*(PID[^\\s]*)")

func validatePSArgs(psArgs string) error {
Expand Down
2 changes: 1 addition & 1 deletion libnetwork/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ func (c *Controller) NewNetwork(ctx context.Context, networkType, name string, i
//
// To cut a long story short: if this broke anything, you know who to blame :)
if err := c.addNetwork(ctx, nw); err != nil {
if _, ok := err.(types.MaskableError); !ok { //nolint:gosimple
if _, ok := err.(types.MaskableError); !ok {
return nil, err
}
}
Expand Down
2 changes: 1 addition & 1 deletion oci/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
// that *only* passes `a` as value: `echo a > /sys/fs/cgroup/1/devices.allow, which would be
// the "implicit" equivalent of "a *:* rwm". Source-code also looks to confirm this, and returns
// early for "a" (all); https://github.com/torvalds/linux/blob/v5.10/security/device_cgroup.c#L614-L642
var deviceCgroupRuleRegex = lazyregexp.New("^([acb]) ([0-9]+|\\*):([0-9]+|\\*) ([rwm]{1,3})$") //nolint: gosimple
var deviceCgroupRuleRegex = lazyregexp.New("^([acb]) ([0-9]+|\\*):([0-9]+|\\*) ([rwm]{1,3})$")

// SetCapabilities sets the provided capabilities on the spec
// All capabilities are added if privileged is true.
Expand Down
Loading