Skip to content

Commit

Permalink
Merge pull request acorn-io#1395 from cjellick/goimports
Browse files Browse the repository at this point in the history
Add goimports to lint check
  • Loading branch information
cjellick authored Mar 27, 2023
2 parents 2f1dc3b + 2102449 commit e20956c
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 28 deletions.
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ linters:
- typecheck
- thelper
- unused
- goimports
fast: false
max-same-issues: 50
5 changes: 3 additions & 2 deletions integration/client/info/info_test.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package info_test

import (
"testing"
"time"

"github.com/acorn-io/acorn/integration/helper"
v1 "github.com/acorn-io/acorn/pkg/apis/api.acorn.io/v1"
"github.com/acorn-io/acorn/pkg/client"
"github.com/acorn-io/acorn/pkg/config"
kclient "github.com/acorn-io/acorn/pkg/k8sclient"
"github.com/acorn-io/acorn/pkg/project"
"github.com/stretchr/testify/assert"
"testing"
"time"
)

func TestDefaultClientInfoOneNamespace(t *testing.T) {
Expand Down
7 changes: 4 additions & 3 deletions integration/log/log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ package log

import (
"context"
"sort"
"strings"
"testing"

"github.com/acorn-io/acorn/integration/helper"
apiv1 "github.com/acorn-io/acorn/pkg/apis/api.acorn.io/v1"
v1 "github.com/acorn-io/acorn/pkg/apis/internal.acorn.io/v1"
"github.com/acorn-io/acorn/pkg/client"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"sort"
"strings"
"testing"
)

const sampleLog = `line 1-1
Expand Down
1 change: 1 addition & 0 deletions pkg/cli/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cli

import (
"context"

cli "github.com/acorn-io/acorn/pkg/cli/builder"
"github.com/acorn-io/acorn/pkg/cli/builder/table"
"github.com/acorn-io/acorn/pkg/client"
Expand Down
12 changes: 6 additions & 6 deletions pkg/cli/containers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ package cli

import (
"fmt"
apiv1 "github.com/acorn-io/acorn/pkg/apis/api.acorn.io/v1"
v1 "github.com/acorn-io/acorn/pkg/apis/internal.acorn.io/v1"
"github.com/acorn-io/acorn/pkg/client"
"github.com/acorn-io/acorn/pkg/mocks"
"github.com/golang/mock/gomock"
"io"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"os"
"strings"
"testing"
"time"

apiv1 "github.com/acorn-io/acorn/pkg/apis/api.acorn.io/v1"
v1 "github.com/acorn-io/acorn/pkg/apis/internal.acorn.io/v1"
"github.com/acorn-io/acorn/pkg/cli/testdata"
"github.com/acorn-io/acorn/pkg/client"
"github.com/acorn-io/acorn/pkg/mocks"
"github.com/golang/mock/gomock"
"github.com/spf13/cobra"
"github.com/stretchr/testify/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions pkg/cli/info_test.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package cli

import (
apiv1 "github.com/acorn-io/acorn/pkg/apis/api.acorn.io/v1"
"github.com/acorn-io/acorn/pkg/mocks"
"io"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"os"
"strings"
"testing"

apiv1 "github.com/acorn-io/acorn/pkg/apis/api.acorn.io/v1"
"github.com/acorn-io/acorn/pkg/cli/testdata"
"github.com/acorn-io/acorn/pkg/mocks"
"github.com/golang/mock/gomock"
"github.com/spf13/cobra"
"github.com/stretchr/testify/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func TestInfo(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/appdefinition/deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package appdefinition

import (
"encoding/base64"
"github.com/acorn-io/acorn/pkg/digest"
"github.com/acorn-io/acorn/pkg/secrets"
"testing"

v1 "github.com/acorn-io/acorn/pkg/apis/internal.acorn.io/v1"
"github.com/acorn-io/acorn/pkg/controller/namespace"
"github.com/acorn-io/acorn/pkg/digest"
"github.com/acorn-io/acorn/pkg/scheme"
"github.com/acorn-io/acorn/pkg/secrets"
"github.com/acorn-io/baaah/pkg/router"
"github.com/acorn-io/baaah/pkg/router/tester"
"github.com/google/go-containerregistry/pkg/name"
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/appdefinition/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package appdefinition

import (
"fmt"
"github.com/acorn-io/acorn/pkg/secrets"
"sort"
"strconv"
"strings"

v1 "github.com/acorn-io/acorn/pkg/apis/internal.acorn.io/v1"
"github.com/acorn-io/acorn/pkg/labels"
"github.com/acorn-io/acorn/pkg/secrets"
"github.com/acorn-io/acorn/pkg/volume"
"github.com/acorn-io/baaah/pkg/router"
"github.com/acorn-io/baaah/pkg/typed"
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/routes.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package controller

import (
policyv1 "k8s.io/api/policy/v1"
"net/http"

v1 "github.com/acorn-io/acorn/pkg/apis/internal.acorn.io/v1"
Expand All @@ -26,6 +25,7 @@ import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
netv1 "k8s.io/api/networking/v1"
policyv1 "k8s.io/api/policy/v1"
rbacv1 "k8s.io/api/rbac/v1"
storagev1 "k8s.io/api/storage/v1"
klabels "k8s.io/apimachinery/pkg/labels"
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/secrets/secret_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package secrets

import (
"regexp"
"strings"
"testing"

v1 "github.com/acorn-io/acorn/pkg/apis/internal.acorn.io/v1"
Expand All @@ -10,8 +12,6 @@ import (
"github.com/stretchr/testify/assert"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"regexp"
"strings"
)

func TestSecretImageReference(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/dns/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/sirupsen/logrus"
corev1 "k8s.io/api/core/v1"
"k8s.io/api/networking/v1"
v1 "k8s.io/api/networking/v1"
kclient "sigs.k8s.io/controller-runtime/pkg/client"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/imagesystem/buildertemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package imagesystem

import (
"fmt"
v1 "github.com/acorn-io/acorn/pkg/apis/internal.acorn.io/v1"
"github.com/acorn-io/acorn/pkg/labels"
"path/filepath"

v1 "github.com/acorn-io/acorn/pkg/apis/internal.acorn.io/v1"
"github.com/acorn-io/acorn/pkg/labels"
"github.com/acorn-io/acorn/pkg/system"
"github.com/acorn-io/acorn/pkg/tolerations"
appsv1 "k8s.io/api/apps/v1"
Expand Down
4 changes: 2 additions & 2 deletions pkg/log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/sirupsen/logrus"
"io"
"k8s.io/utils/strings/slices"
"strings"
"sync"
"time"
Expand All @@ -19,6 +17,7 @@ import (
applabels "github.com/acorn-io/acorn/pkg/labels"
"github.com/acorn-io/baaah/pkg/restconfig"
"github.com/acorn-io/baaah/pkg/watcher"
"github.com/sirupsen/logrus"
"golang.org/x/sync/errgroup"
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
Expand All @@ -27,6 +26,7 @@ import (
"k8s.io/client-go/kubernetes"
v12 "k8s.io/client-go/kubernetes/typed/core/v1"
"k8s.io/client-go/rest"
"k8s.io/utils/strings/slices"
"sigs.k8s.io/controller-runtime/pkg/client"
)

Expand Down
3 changes: 2 additions & 1 deletion pkg/log/log_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package log

import (
"testing"

"github.com/acorn-io/acorn/pkg/labels"
"github.com/stretchr/testify/assert"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"testing"
)

var (
Expand Down
5 changes: 3 additions & 2 deletions pkg/log/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package log

import (
"context"
"strings"
"time"

v1 "github.com/acorn-io/acorn/pkg/apis/api.acorn.io/v1"
"github.com/acorn-io/acorn/pkg/client"
"github.com/pterm/pterm"
"github.com/sirupsen/logrus"
"strings"
"time"
)

var (
Expand Down

0 comments on commit e20956c

Please sign in to comment.