From 340cb2b38556c4b640cfaf91bbf5d253cdb5a7eb Mon Sep 17 00:00:00 2001 From: Jeffrey Regan Date: Fri, 31 Aug 2018 16:54:38 -0700 Subject: [PATCH] Remove unnecessary import aliases. --- pkg/patch/jsonpatch.go | 2 +- pkg/patch/transformer/factory.go | 7 +++---- pkg/patch/transformer/factory_test.go | 3 +-- pkg/patch/transformer/patchjson6902json.go | 3 +-- pkg/patch/transformer/patchjson6902json_test.go | 3 +-- pkg/patch/transformer/patchjson6902yaml.go | 3 +-- pkg/patch/transformer/patchjson6902yaml_test.go | 2 +- pkg/patch/transformer/util.go | 2 +- 8 files changed, 10 insertions(+), 15 deletions(-) diff --git a/pkg/patch/jsonpatch.go b/pkg/patch/jsonpatch.go index 8fca0b1e29..4247cccb82 100644 --- a/pkg/patch/jsonpatch.go +++ b/pkg/patch/jsonpatch.go @@ -17,7 +17,7 @@ limitations under the License. package patch import ( - yamlpatch "github.com/krishicks/yaml-patch" + "github.com/krishicks/yaml-patch" ) // PatchJson6902 represents a json patch for an object diff --git a/pkg/patch/transformer/factory.go b/pkg/patch/transformer/factory.go index 2b7da3b003..4868a0938f 100644 --- a/pkg/patch/transformer/factory.go +++ b/pkg/patch/transformer/factory.go @@ -19,14 +19,13 @@ package transformer import ( "fmt" - jsonpatch "github.com/evanphx/json-patch" - yamlpatch "github.com/krishicks/yaml-patch" - "k8s.io/apimachinery/pkg/runtime/schema" - + "github.com/evanphx/json-patch" + "github.com/krishicks/yaml-patch" "github.com/kubernetes-sigs/kustomize/pkg/loader" "github.com/kubernetes-sigs/kustomize/pkg/patch" "github.com/kubernetes-sigs/kustomize/pkg/resource" "github.com/kubernetes-sigs/kustomize/pkg/transformers" + "k8s.io/apimachinery/pkg/runtime/schema" ) // PatchJson6902Factory makes PatchJson6902 transformers. diff --git a/pkg/patch/transformer/factory_test.go b/pkg/patch/transformer/factory_test.go index bf87bdca11..060966a966 100644 --- a/pkg/patch/transformer/factory_test.go +++ b/pkg/patch/transformer/factory_test.go @@ -20,10 +20,9 @@ import ( "strings" "testing" - yaml "gopkg.in/yaml.v2" - "github.com/kubernetes-sigs/kustomize/pkg/internal/loadertest" "github.com/kubernetes-sigs/kustomize/pkg/patch" + "gopkg.in/yaml.v2" ) func TestNewPatchJson6902FactoryNull(t *testing.T) { diff --git a/pkg/patch/transformer/patchjson6902json.go b/pkg/patch/transformer/patchjson6902json.go index c8844bc883..dacce721a0 100644 --- a/pkg/patch/transformer/patchjson6902json.go +++ b/pkg/patch/transformer/patchjson6902json.go @@ -17,8 +17,7 @@ limitations under the License. package transformer import ( - jsonpatch "github.com/evanphx/json-patch" - + "github.com/evanphx/json-patch" "github.com/kubernetes-sigs/kustomize/pkg/resmap" "github.com/kubernetes-sigs/kustomize/pkg/resource" "github.com/kubernetes-sigs/kustomize/pkg/transformers" diff --git a/pkg/patch/transformer/patchjson6902json_test.go b/pkg/patch/transformer/patchjson6902json_test.go index 5392095e55..7db139099d 100644 --- a/pkg/patch/transformer/patchjson6902json_test.go +++ b/pkg/patch/transformer/patchjson6902json_test.go @@ -20,8 +20,7 @@ import ( "reflect" "testing" - jsonpatch "github.com/evanphx/json-patch" - + "github.com/evanphx/json-patch" "github.com/kubernetes-sigs/kustomize/pkg/resmap" "github.com/kubernetes-sigs/kustomize/pkg/resource" ) diff --git a/pkg/patch/transformer/patchjson6902yaml.go b/pkg/patch/transformer/patchjson6902yaml.go index 70542c3876..4dfc739f20 100644 --- a/pkg/patch/transformer/patchjson6902yaml.go +++ b/pkg/patch/transformer/patchjson6902yaml.go @@ -18,8 +18,7 @@ package transformer import ( "github.com/ghodss/yaml" - yamlpatch "github.com/krishicks/yaml-patch" - + "github.com/krishicks/yaml-patch" "github.com/kubernetes-sigs/kustomize/pkg/resmap" "github.com/kubernetes-sigs/kustomize/pkg/resource" "github.com/kubernetes-sigs/kustomize/pkg/transformers" diff --git a/pkg/patch/transformer/patchjson6902yaml_test.go b/pkg/patch/transformer/patchjson6902yaml_test.go index 4aed62a4a3..cab331bf2e 100644 --- a/pkg/patch/transformer/patchjson6902yaml_test.go +++ b/pkg/patch/transformer/patchjson6902yaml_test.go @@ -20,7 +20,7 @@ import ( "reflect" "testing" - yamlpatch "github.com/krishicks/yaml-patch" + "github.com/krishicks/yaml-patch" "github.com/kubernetes-sigs/kustomize/pkg/resmap" "github.com/kubernetes-sigs/kustomize/pkg/resource" "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/patch/transformer/util.go b/pkg/patch/transformer/util.go index d6dcab5e2f..62ac9b3ad8 100644 --- a/pkg/patch/transformer/util.go +++ b/pkg/patch/transformer/util.go @@ -27,7 +27,7 @@ import ( func findTargetObj(m resmap.ResMap, targetId resource.ResId) (*resource.Resource, error) { matchedIds := m.FindByGVKN(targetId) if targetId.Namespace() != "" { - ids := []resource.ResId{} + var ids []resource.ResId for _, id := range matchedIds { if id.Namespace() == targetId.Namespace() { ids = append(ids, id)