From 203ddc25f8dba9a6f0de4439fab3cdea4df27c40 Mon Sep 17 00:00:00 2001 From: depthlending Date: Fri, 22 Mar 2024 18:03:32 +0800 Subject: [PATCH] chore: fix function names Signed-off-by: depthlending --- .../generate/clusterserviceversion/clusterserviceversion.go | 2 +- internal/generate/internal/genutil.go | 2 +- internal/plugins/helm/v1/init.go | 2 +- internal/scorecard/formatting.go | 2 +- internal/util/projutil/interactive_promt_util.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/generate/clusterserviceversion/clusterserviceversion.go b/internal/generate/clusterserviceversion/clusterserviceversion.go index 6e66aaa0f8..3bb733604c 100644 --- a/internal/generate/clusterserviceversion/clusterserviceversion.go +++ b/internal/generate/clusterserviceversion/clusterserviceversion.go @@ -127,7 +127,7 @@ func (g *Generator) Generate(opts ...Option) (err error) { return genutil.WriteObject(w, csv) } -// setSDKAnnotations adds SDK metric labels to the base if they do not exist. +// setAnnotations adds SDK metric labels to the base if they do not exist. func (g Generator) setAnnotations(csv *v1alpha1.ClusterServiceVersion) { annotations := csv.GetAnnotations() if annotations == nil { diff --git a/internal/generate/internal/genutil.go b/internal/generate/internal/genutil.go index 630fece9b9..f4847a3e41 100644 --- a/internal/generate/internal/genutil.go +++ b/internal/generate/internal/genutil.go @@ -70,7 +70,7 @@ func WriteObject(w io.Writer, obj interface{}) error { return write(w, b) } -// WriteObject writes any object to w. +// WriteYAML writes any object to w. func WriteYAML(w io.Writer, obj interface{}) error { b, err := yaml.Marshal(obj) if err != nil { diff --git a/internal/plugins/helm/v1/init.go b/internal/plugins/helm/v1/init.go index cc6ba11b20..11a8661c02 100644 --- a/internal/plugins/helm/v1/init.go +++ b/internal/plugins/helm/v1/init.go @@ -51,7 +51,7 @@ type initSubcommand struct { var _ plugin.InitSubcommand = &initSubcommand{} -// UpdateContext define plugin context +// UpdateMetadata define plugin context func (p *initSubcommand) UpdateMetadata(cliMeta plugin.CLIMetadata, subcmdMeta *plugin.SubcommandMetadata) { subcmdMeta.Description = `Initialize a new Helm-based operator project. diff --git a/internal/scorecard/formatting.go b/internal/scorecard/formatting.go index e20d285312..2651a726a1 100644 --- a/internal/scorecard/formatting.go +++ b/internal/scorecard/formatting.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// getTestResult fetches the test pod log and converts it into +// getTestStatus fetches the test pod log and converts it into // Test format func (r PodTestRunner) getTestStatus(ctx context.Context, p *v1.Pod) (output *v1alpha3.TestStatus) { logBytes, err := getPodLog(ctx, r.Client, p) diff --git a/internal/util/projutil/interactive_promt_util.go b/internal/util/projutil/interactive_promt_util.go index 780eb05bb9..8e4736139f 100644 --- a/internal/util/projutil/interactive_promt_util.go +++ b/internal/util/projutil/interactive_promt_util.go @@ -84,7 +84,7 @@ func getStringArray(rd io.Reader, msg string) []string { } } -// readstdin reads a line from stdin and returns the value. +// readLine reads a line from stdin and returns the value. func readLine(reader *bufio.Reader) string { text, err := reader.ReadString('\n') if err != nil {