Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename some variables. #1158

Merged
merged 1 commit into from
Dec 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions pkg/kudoctl/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,36 +143,36 @@ func (initCmd *initCmd) run() error {
//define an Encoder to replace YAMLWriter
if strings.ToLower(initCmd.output) == "yaml" {

var mans []string
var manifests []string

crd, err := cmdInit.CRDs().AsYaml()
if err != nil {
return err
}
mans = append(mans, crd...)
manifests = append(manifests, crd...)

if !initCmd.crdOnly {
prereq, err := cmdInit.PrereqManifests(opts)
if err != nil {
return err
}
mans = append(mans, prereq...)
manifests = append(manifests, prereq...)

if len(opts.Webhooks) != 0 { // right now there's only 0 or 1 webhook, so this is good enough
prereq, err := cmdInit.WebhookManifests(opts.Namespace)
webhooks, err := cmdInit.WebhookManifests(opts.Namespace)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, though it's already better than prereq:

Suggested change
webhooks, err := cmdInit.WebhookManifests(opts.Namespace)
webhookManifests, err := cmdInit.WebhookManifests(opts.Namespace)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uf that is almost too long for me :)

Copy link
Contributor

@zen-dog zen-dog Dec 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waaay too long! Let's just accept the fact that Go has no Getters and Setters and intentionally chooses small variable names, especially in the local scope.

if err != nil {
return err
}
mans = append(mans, prereq...)
manifests = append(manifests, webhooks...)
}

deploy, err := cmdInit.ManagerManifests(opts)
if err != nil {
return err
}
mans = append(mans, deploy...)
manifests = append(manifests, deploy...)
}
if err := initCmd.YAMLWriter(initCmd.out, mans); err != nil {
if err := initCmd.YAMLWriter(initCmd.out, manifests); err != nil {
return err
}
}
Expand Down