Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Note: trying github's code review suggestions feature. Might cause CLA check to break.

Co-Authored-By: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
  • Loading branch information
ahmetb and corneliusweig authored Jun 19, 2019
1 parent 8f159bc commit 20930b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/index/indexscanner/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func LoadPluginListFromFS(indexDir string) ([]index.Plugin, error) {
return nil, errors.Wrap(err, "failed to open index dir")
}

list := make([]index.Plugin, 0)
list := make([]index.Plugin, 0, len(files))
for _, f := range files {
if f.IsDir() {
continue
Expand Down Expand Up @@ -109,7 +109,7 @@ func DecodePluginFile(r io.Reader) (index.Plugin, error) {
}
decoder := json.NewDecoder(bytes.NewReader(jsonRaw))

// TODO(ahmetb): when we have a stable API that don't add new fields,
// TODO(ahmetb): when we have a stable API that won't add new fields,
// we can consider failing on unknown fields. Currently disabling due to
// incremental field additions to plugin manifests independently from the
// installed version of krew.
Expand Down
4 changes: 2 additions & 2 deletions pkg/index/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type Plugin struct {
Spec PluginSpec `json:"spec"`
}

// PluginSpec describes a plugin specification.
// PluginSpec is the plugin specification.
type PluginSpec struct {
Version string `json:"version,omitempty"`
ShortDescription string `json:"shortDescription,omitempty"`
Expand All @@ -52,7 +52,7 @@ type Platform struct {
Bin string `json:"bin"`
}

// FileOperation explains a file copying operation from plugin archive to the
// FileOperation specifies a file copying operation from plugin archive to the
// installation directory.
type FileOperation struct {
From string `json:"from,omitempty"`
Expand Down

0 comments on commit 20930b1

Please sign in to comment.