From 5c427ef70211b43a79827be7d06e61ffd5ab67ba Mon Sep 17 00:00:00 2001 From: Amine Chouki Date: Fri, 23 Jul 2021 10:55:31 -0400 Subject: [PATCH] Move pat_suggest.go into `cli` package Signed-off-by: Amine Chouki --- cli/mobycli/exec.go | 2 +- {pkg/utils => cli/mobycli}/pat_suggest.go | 6 +++--- {pkg/utils => cli/mobycli}/pat_suggest_test.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) rename {pkg/utils => cli/mobycli}/pat_suggest.go (93%) rename {pkg/utils => cli/mobycli}/pat_suggest_test.go (99%) diff --git a/cli/mobycli/exec.go b/cli/mobycli/exec.go index bf6c91154..552987f85 100644 --- a/cli/mobycli/exec.go +++ b/cli/mobycli/exec.go @@ -83,7 +83,7 @@ func Exec(root *cobra.Command) { utils.DisplayScanSuggestMsg() } if command == "login" && !metrics.HasQuietFlag(commandArgs) { - utils.DisplayPATSuggestMsg(commandArgs) + displayPATSuggestMsg(commandArgs) } metrics.Track(store.DefaultContextType, os.Args[1:], compose.SuccessStatus) diff --git a/pkg/utils/pat_suggest.go b/cli/mobycli/pat_suggest.go similarity index 93% rename from pkg/utils/pat_suggest.go rename to cli/mobycli/pat_suggest.go index 1574a7f06..24e5363cf 100644 --- a/pkg/utils/pat_suggest.go +++ b/cli/mobycli/pat_suggest.go @@ -14,7 +14,7 @@ limitations under the License. */ -package utils +package mobycli import ( "fmt" @@ -35,8 +35,8 @@ For better security, log in with a limited-privilege personal access token. Lear patPrefix = "dckrp_" ) -// DisplayPATSuggestMsg displays a message suggesting users to use PATs instead of passwords to reduce scope. -func DisplayPATSuggestMsg(cmdArgs []string) { +// displayPATSuggestMsg displays a message suggesting users to use PATs instead of passwords to reduce scope. +func displayPATSuggestMsg(cmdArgs []string) { if os.Getenv("DOCKER_PAT_SUGGEST") == "false" { return } diff --git a/pkg/utils/pat_suggest_test.go b/cli/mobycli/pat_suggest_test.go similarity index 99% rename from pkg/utils/pat_suggest_test.go rename to cli/mobycli/pat_suggest_test.go index 7708b34c7..8d229829a 100644 --- a/pkg/utils/pat_suggest_test.go +++ b/cli/mobycli/pat_suggest_test.go @@ -14,7 +14,7 @@ limitations under the License. */ -package utils +package mobycli import ( "testing"