From b9eadd3186023fafe13421c9bd10ee4cc0883bca Mon Sep 17 00:00:00 2001 From: wyrapeseed Date: Wed, 15 Oct 2025 11:19:41 +0800 Subject: [PATCH] chore: fix some comment format Signed-off-by: wyrapeseed --- internal/plugin/installer/extractor.go | 4 ++-- internal/plugin/runtime_subprocess_test.go | 2 +- internal/sympath/walk.go | 2 +- pkg/cmd/search_repo.go | 2 +- pkg/engine/files.go | 2 +- pkg/getter/httpgetter_test.go | 4 ++-- pkg/getter/plugingetter.go | 2 +- pkg/strvals/parser.go | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/plugin/installer/extractor.go b/internal/plugin/installer/extractor.go index 407138197..71efebc67 100644 --- a/internal/plugin/installer/extractor.go +++ b/internal/plugin/installer/extractor.go @@ -85,10 +85,10 @@ func NewExtractor(source string) (Extractor, error) { // // - The character `:` is considered illegal because it is a separator on UNIX and a // drive designator on Windows. -// - The path component `..` is considered suspicions, and therefore illegal +// - The path component `..` is considered suspicious, and therefore illegal // - The character \ (backslash) is treated as a path separator and is converted to /. // - Beginning a path with a path separator is illegal -// - Rudimentary symlink protects are offered by SecureJoin. +// - Rudimentary symlink protections are offered by SecureJoin. func cleanJoin(root, dest string) (string, error) { // On Windows, this is a drive separator. On UNIX-like, this is the path list separator. diff --git a/internal/plugin/runtime_subprocess_test.go b/internal/plugin/runtime_subprocess_test.go index 243f4ad7c..ed251d28b 100644 --- a/internal/plugin/runtime_subprocess_test.go +++ b/internal/plugin/runtime_subprocess_test.go @@ -71,7 +71,7 @@ func TestSubprocessPluginRuntime(t *testing.T) { output, err := p.Invoke(t.Context(), &Input{ Message: schema.InputMessageCLIV1{ ExtraArgs: []string{"arg1", "arg2"}, - //Env: []string{"FOO=bar"}, + // Env: []string{"FOO=bar"}, }, }) diff --git a/internal/sympath/walk.go b/internal/sympath/walk.go index f67b9f1b9..812bb68ce 100644 --- a/internal/sympath/walk.go +++ b/internal/sympath/walk.go @@ -70,7 +70,7 @@ func symwalk(path string, info os.FileInfo, walkFn filepath.WalkFunc) error { if err != nil { return fmt.Errorf("error evaluating symlink %s: %w", path, err) } - //This log message is to highlight a symlink that is being used within a chart, symlinks can be used for nefarious reasons. + // This log message is to highlight a symlink that is being used within a chart, symlinks can be used for nefarious reasons. slog.Info("found symbolic link in path. Contents of linked file included and used", "path", path, "resolved", resolved) if info, err = os.Lstat(resolved); err != nil { return err diff --git a/pkg/cmd/search_repo.go b/pkg/cmd/search_repo.go index 35608e22e..07345a48f 100644 --- a/pkg/cmd/search_repo.go +++ b/pkg/cmd/search_repo.go @@ -287,7 +287,7 @@ func compListChartsOfRepo(repoName string, prefix string) []string { if isNotExist(err) { // If there is no cached charts file, fallback to the full index file. // This is much slower but can happen after the caching feature is first - // installed but before the user does a 'helm repo update' to generate the + // installed but before the user does a 'helm repo update' to generate the // first cached charts file. path = filepath.Join(settings.RepositoryCache, helmpath.CacheIndexFile(repoName)) if indexFile, err := repo.LoadIndexFile(path); err == nil { diff --git a/pkg/engine/files.go b/pkg/engine/files.go index f0a86988e..7834cac2c 100644 --- a/pkg/engine/files.go +++ b/pkg/engine/files.go @@ -64,7 +64,7 @@ func (f files) Get(name string) string { } // Glob takes a glob pattern and returns another files object only containing -// matched files. +// matched files. // // This is designed to be called from a template. // diff --git a/pkg/getter/httpgetter_test.go b/pkg/getter/httpgetter_test.go index f87d71877..96bfa1ece 100644 --- a/pkg/getter/httpgetter_test.go +++ b/pkg/getter/httpgetter_test.go @@ -520,11 +520,11 @@ func TestHTTPGetterTarDownload(t *testing.T) { b := make([]byte, 512) f.Read(b) - //Get the file size + // Get the file size FileStat, _ := f.Stat() FileSize := strconv.FormatInt(FileStat.Size(), 10) - //Simulating improper header values from bitbucket + // Simulating improper header values from bitbucket w.Header().Set("Content-Type", "application/x-tar") w.Header().Set("Content-Encoding", "gzip") w.Header().Set("Content-Length", FileSize) diff --git a/pkg/getter/plugingetter.go b/pkg/getter/plugingetter.go index 32dbc70c9..d74611637 100644 --- a/pkg/getter/plugingetter.go +++ b/pkg/getter/plugingetter.go @@ -109,7 +109,7 @@ func (g *getterPlugin) Get(href string, options ...Option) (*bytes.Buffer, error Protocol: u.Scheme, }, // TODO should we pass Stdin, Stdout, and Stderr through Input here to getter plugins? - //Stdout: os.Stdout, + // Stdout: os.Stdout, } output, err := g.plg.Invoke(context.Background(), input) if err != nil { diff --git a/pkg/strvals/parser.go b/pkg/strvals/parser.go index c65e98c84..86e349f37 100644 --- a/pkg/strvals/parser.go +++ b/pkg/strvals/parser.go @@ -237,7 +237,7 @@ func (t *parser) key(data map[string]interface{}, nestedNameLevel int) (reterr e _, err = t.emptyVal() return err } - //End of key. Consume =, Get value. + // End of key. Consume =, Get value. // FIXME: Get value list first vl, e := t.valList() switch e {