golangci: enable goimports

Enable the goimports linter and fix reports.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2020-03-05 20:03:44 +01:00
parent 60e9e7ca9c
commit 593eb7625a
15 changed files with 15 additions and 11 deletions

View File

@ -24,7 +24,6 @@ linters:
- goconst
- gocyclo
- golint
- goimports
- gosec
- lll
- maligned

View File

@ -2,6 +2,7 @@ package main
import (
"fmt"
"github.com/containers/buildah/pkg/formats"
"github.com/containers/libpod/cmd/podman/cliconfig"
"github.com/containers/libpod/pkg/adapter"

View File

@ -4,6 +4,7 @@ package main
import (
"errors"
"github.com/containers/libpod/cmd/podman/cliconfig"
"github.com/containers/libpod/pkg/adapter"
"github.com/containers/libpod/pkg/rootless"

View File

@ -2,6 +2,7 @@ package main
import (
"fmt"
"github.com/containers/libpod/cmd/podman/cliconfig"
"github.com/containers/libpod/pkg/adapter"
"github.com/pkg/errors"

View File

@ -3,13 +3,13 @@ package image
import (
"context"
"fmt"
"github.com/pkg/errors"
"path/filepath"
"strconv"
"strings"
"time"
"github.com/containers/libpod/pkg/inspect"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)

View File

@ -21,7 +21,7 @@ import (
"github.com/containers/image/v5/directory"
dockerarchive "github.com/containers/image/v5/docker/archive"
ociarchive "github.com/containers/image/v5/oci/archive"
"github.com/opencontainers/image-spec/specs-go/v1"
v1 "github.com/opencontainers/image-spec/specs-go/v1"
)
// Runtime API

View File

@ -10,7 +10,7 @@ import (
"github.com/containers/libpod/libpod/image"
"github.com/containers/libpod/pkg/rootless"
"github.com/containers/libpod/pkg/util"
"github.com/opencontainers/image-spec/specs-go/v1"
v1 "github.com/opencontainers/image-spec/specs-go/v1"
spec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/generate"
"github.com/pkg/errors"

View File

@ -8,7 +8,7 @@ import (
"github.com/containers/image/v5/types"
"github.com/containers/libpod/libpod/define"
"github.com/containers/storage"
"github.com/opencontainers/image-spec/specs-go/v1"
v1 "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/opentracing/opentracing-go"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"

View File

@ -2,12 +2,12 @@ package handlers
import (
"fmt"
"github.com/docker/docker/api/types"
"net/http"
"github.com/containers/libpod/libpod"
"github.com/containers/libpod/libpod/define"
"github.com/containers/libpod/pkg/api/handlers/utils"
"github.com/docker/docker/api/types"
"github.com/gorilla/schema"
"github.com/pkg/errors"
)

View File

@ -3,7 +3,6 @@ package utils
import (
"encoding/json"
"fmt"
"github.com/pkg/errors"
"io"
"net/http"
"net/url"
@ -11,6 +10,7 @@ import (
"strings"
"github.com/gorilla/mux"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)

View File

@ -2,6 +2,7 @@ package apparmor
import (
"errors"
libpodVersion "github.com/containers/libpod/version"
)

View File

@ -2,10 +2,10 @@ package containers
import (
"context"
"github.com/containers/libpod/pkg/bindings"
"net/http"
"github.com/containers/libpod/libpod"
"github.com/containers/libpod/pkg/bindings"
)
// RunHealthCheck executes the container's healthcheck and returns the health status of the

View File

@ -5,13 +5,13 @@ import (
"bytes"
"context"
"fmt"
"github.com/sirupsen/logrus"
"io"
osexec "os/exec"
"time"
rspec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
// DefaultPostKillTimeout is the recommended default post-kill timeout.

View File

@ -4,7 +4,7 @@ import (
"os"
"strconv"
"github.com/cyphar/filepath-securejoin"
securejoin "github.com/cyphar/filepath-securejoin"
"github.com/opencontainers/runc/libcontainer/user"
"github.com/sirupsen/logrus"
)

View File

@ -2,12 +2,13 @@ package specgen
import (
"context"
"os"
"github.com/containers/libpod/libpod"
"github.com/containers/libpod/libpod/config"
"github.com/containers/libpod/libpod/define"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"os"
)
// MakeContainer creates a container based on the SpecGenerator