From 956e101c7d75d113f4726906c23c1b0ce57842ea Mon Sep 17 00:00:00 2001 From: Cornelius Weig Date: Wed, 5 Feb 2020 01:05:55 +0100 Subject: [PATCH] Move tag fetch utils to `cmd/internal` package --- .../update.go => cmd/krew/cmd/internal/fetch_tag.go | 2 +- .../update_test.go => cmd/krew/cmd/internal/fetch_tag_test.go | 2 +- cmd/krew/cmd/root.go | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) rename internal/updatecheck/update.go => cmd/krew/cmd/internal/fetch_tag.go (98%) rename internal/updatecheck/update_test.go => cmd/krew/cmd/internal/fetch_tag_test.go (99%) diff --git a/internal/updatecheck/update.go b/cmd/krew/cmd/internal/fetch_tag.go similarity index 98% rename from internal/updatecheck/update.go rename to cmd/krew/cmd/internal/fetch_tag.go index 8c4fc26b..8ec5ce77 100644 --- a/internal/updatecheck/update.go +++ b/cmd/krew/cmd/internal/fetch_tag.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package updatecheck +package internal import ( "encoding/json" diff --git a/internal/updatecheck/update_test.go b/cmd/krew/cmd/internal/fetch_tag_test.go similarity index 99% rename from internal/updatecheck/update_test.go rename to cmd/krew/cmd/internal/fetch_tag_test.go index e2dd0c4d..feb79ca8 100644 --- a/internal/updatecheck/update_test.go +++ b/cmd/krew/cmd/internal/fetch_tag_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package updatecheck +package internal import ( "net/http" diff --git a/cmd/krew/cmd/root.go b/cmd/krew/cmd/root.go index 00492a28..dd815e59 100644 --- a/cmd/krew/cmd/root.go +++ b/cmd/krew/cmd/root.go @@ -35,7 +35,6 @@ import ( "sigs.k8s.io/krew/internal/installation/receipt" "sigs.k8s.io/krew/internal/installation/semver" "sigs.k8s.io/krew/internal/receiptsmigration" - "sigs.k8s.io/krew/internal/updatecheck" "sigs.k8s.io/krew/internal/version" "sigs.k8s.io/krew/pkg/constants" ) @@ -121,7 +120,7 @@ func preRun(cmd *cobra.Command, _ []string) error { return } var err error - latestTag, err = updatecheck.FetchLatestTag() + latestTag, err = internal.FetchLatestTag() if err != nil { klog.V(1).Infoln("WARNING:", err) }