Skip to content

Commit

Permalink
Add goimports to hack/go-fmt.go (#172)
Browse files Browse the repository at this point in the history
* Add goimports to hack/go-fmt.go (fixes #171)

* Run goimports
  • Loading branch information
Kevin-Mok authored Oct 6, 2020
1 parent a1a10ea commit 1d8a597
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 12 deletions.
3 changes: 3 additions & 0 deletions hack/go-fmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@


gofmt -s -l -w cmd/ pkg/ version/
# get the goimports binary
command -v goimports >/dev/null || go build -o $GOPATH/bin/goimports golang.org/x/tools/cmd/goimports
goimports -l -w cmd/ pkg/ version/

if [[ -n ${CI} ]]; then
git diff --exit-code
Expand Down
1 change: 1 addition & 0 deletions pkg/cluster/kubernetes/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package kubernetes
import (
ctx "context"
"fmt"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down
3 changes: 2 additions & 1 deletion pkg/cluster/kubernetes/events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ package kubernetes
import (
ctx "context"
"fmt"
"testing"

"github.com/m88i/nexus-operator/pkg/apis/apps/v1alpha1"
"github.com/m88i/nexus-operator/pkg/test"
"github.com/stretchr/testify/assert"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"testing"
)

func TestRaiseInfoEventf(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/controller/nexus/nexus_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (
"fmt"
"testing"

"reflect"

resUtils "github.com/RHsyseng/operator-utils/pkg/resource"
"github.com/m88i/nexus-operator/pkg/apis/apps/v1alpha1"
nexusres "github.com/m88i/nexus-operator/pkg/controller/nexus/resource"
Expand All @@ -34,7 +36,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/kubernetes/scheme"
"reflect"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/nexus/resource/deployment/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ func normalizeSecurityContext(depDeployment, reqDeployment *appsv1.Deployment) {
if reqDeployment.Spec.Template.Spec.SecurityContext == nil {
depDeployment.Spec.Template.Spec.SecurityContext = nil
}
}
}
3 changes: 2 additions & 1 deletion pkg/controller/nexus/resource/validation/events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ package validation
import (
ctx "context"
"fmt"
"testing"

"github.com/m88i/nexus-operator/pkg/apis/apps/v1alpha1"
"github.com/m88i/nexus-operator/pkg/test"
"github.com/stretchr/testify/assert"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"testing"
)

func Test_createChangedNexusEvent(t *testing.T) {
Expand Down
4 changes: 3 additions & 1 deletion pkg/controller/nexus/resource/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@ package validation

import (
"fmt"

"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client"

"strings"

"github.com/m88i/nexus-operator/pkg/apis/apps/v1alpha1"
"github.com/m88i/nexus-operator/pkg/cluster/kubernetes"
"github.com/m88i/nexus-operator/pkg/cluster/openshift"
"github.com/m88i/nexus-operator/pkg/controller/nexus/update"
"github.com/m88i/nexus-operator/pkg/logger"
corev1 "k8s.io/api/core/v1"
"k8s.io/client-go/discovery"
"strings"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion pkg/controller/nexus/update/events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ package update
import (
ctx "context"
"fmt"
"testing"

"github.com/m88i/nexus-operator/pkg/apis/apps/v1alpha1"
"github.com/m88i/nexus-operator/pkg/test"
"github.com/stretchr/testify/assert"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"testing"
)

func TestCreateUpdateSuccessEvent(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/controller/nexus/update/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ package update
import (
ctx "context"
"fmt"
"strings"

"github.com/m88i/nexus-operator/pkg/apis/apps/v1alpha1"
appsv1 "k8s.io/api/apps/v1"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"strings"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion pkg/controller/nexus/update/monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ package update

import (
"fmt"
"testing"

"github.com/m88i/nexus-operator/pkg/apis/apps/v1alpha1"
"github.com/m88i/nexus-operator/pkg/test"
"github.com/stretchr/testify/assert"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"testing"
)

func TestMonitorUpdate(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions pkg/controller/nexus/update/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ package update

import (
"fmt"
"github.com/heroku/docker-registry-client/registry"
"github.com/m88i/nexus-operator/pkg/logger"
"strconv"
"strings"
"time"

"github.com/heroku/docker-registry-client/registry"
"github.com/m88i/nexus-operator/pkg/logger"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion pkg/controller/nexus/update/tags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
package update

import (
"github.com/stretchr/testify/assert"
"testing"
"time"

"github.com/stretchr/testify/assert"
)

func TestHigherVersion(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/test/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ package test

import (
"context"
"k8s.io/api/core/v1"
"reflect"

v1 "k8s.io/api/core/v1"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/RHsyseng/operator-utils/pkg/resource"
Expand Down

0 comments on commit 1d8a597

Please sign in to comment.