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 - goconst
- gocyclo - gocyclo
- golint - golint
- goimports
- gosec - gosec
- lll - lll
- maligned - maligned

View File

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

View File

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

View File

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

View File

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

View File

@ -21,7 +21,7 @@ import (
"github.com/containers/image/v5/directory" "github.com/containers/image/v5/directory"
dockerarchive "github.com/containers/image/v5/docker/archive" dockerarchive "github.com/containers/image/v5/docker/archive"
ociarchive "github.com/containers/image/v5/oci/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 // Runtime API

View File

@ -10,7 +10,7 @@ import (
"github.com/containers/libpod/libpod/image" "github.com/containers/libpod/libpod/image"
"github.com/containers/libpod/pkg/rootless" "github.com/containers/libpod/pkg/rootless"
"github.com/containers/libpod/pkg/util" "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" spec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/generate" "github.com/opencontainers/runtime-tools/generate"
"github.com/pkg/errors" "github.com/pkg/errors"

View File

@ -8,7 +8,7 @@ import (
"github.com/containers/image/v5/types" "github.com/containers/image/v5/types"
"github.com/containers/libpod/libpod/define" "github.com/containers/libpod/libpod/define"
"github.com/containers/storage" "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/opentracing/opentracing-go"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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