From c5f5f12491faab3440ff1c98fe21270fb2cd6781 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/internal/loadertest/fakeloader.go | 3 --- 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 +- 9 files changed, 10 insertions(+), 18 deletions(-) diff --git a/pkg/internal/loadertest/fakeloader.go b/pkg/internal/loadertest/fakeloader.go index 92355598237..4f530f6aea7 100644 --- a/pkg/internal/loadertest/fakeloader.go +++ b/pkg/internal/loadertest/fakeloader.go @@ -22,9 +22,6 @@ import ( "github.com/kubernetes-sigs/kustomize/pkg/loader" ) -// CleanupCalled indicates if Cleanup is called. -var CleanupCalled = false - // FakeLoader encapsulates the delegate Loader and the fake file system. type FakeLoader struct { fs fs.FileSystem diff --git a/pkg/patch/jsonpatch.go b/pkg/patch/jsonpatch.go index 8fca0b1e296..4247cccb829 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 2b7da3b0035..4868a0938f9 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 bf87bdca112..060966a9666 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 c8844bc8837..dacce721a04 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 5392095e557..7db139099d9 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 70542c38765..4dfc739f20d 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 4aed62a4a30..cab331bf2e6 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 d6dcab5e2fc..62ac9b3ad88 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)