Skip to content

Commit

Permalink
Apply Goreportcard suggestions (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcauberer committed Nov 7, 2021
1 parent 53f2930 commit 9d151d9
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ func EnrichProjectWithServices(project *model.CGProject, config *model.GenerateC

// Generate composition
selectedTemplates := &model.SelectedTemplates{
FrontendServices: []model.PredefinedTemplateConfig{},
BackendServices: []model.PredefinedTemplateConfig{},
DatabaseServices: []model.PredefinedTemplateConfig{},
DbAdminServices: []model.PredefinedTemplateConfig{},
FrontendServices: []model.PredefinedTemplateConfig{},
BackendServices: []model.PredefinedTemplateConfig{},
DatabaseServices: []model.PredefinedTemplateConfig{},
DbAdminServices: []model.PredefinedTemplateConfig{},
ProxyServices: []model.PredefinedTemplateConfig{},
TlsHelperServices: []model.PredefinedTemplateConfig{},
}
Expand Down
2 changes: 1 addition & 1 deletion src/pass/generate/gen_generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func TestGenerateService1(t *testing.T) {
Composition: &spec.Project{
Services: spec.Services{
{
Name: "faunadb",
Name: "faunadb",
Labels: make(spec.Labels),
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/pass/generate/gen_load_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,4 +440,4 @@ func TestLoadConfigFromUrl4(t *testing.T) {
}
// Execute test
loadConfigFromUrl(config, configUrl)
}
}
2 changes: 1 addition & 1 deletion src/project/delete_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func applyDeleteOptions(options ...DeleteOption) DeleteOptions {
opts.WorkingDir += "/"
}
// Check also docker-compose.yaml file
if opts.ComposeFileName == "docker-compose.yml" && fileExists(opts.WorkingDir + "docker-compose.yaml") {
if opts.ComposeFileName == "docker-compose.yml" && fileExists(opts.WorkingDir+"docker-compose.yaml") {
opts.ComposeFileName = "docker-compose.yaml"
}
return opts
Expand Down
2 changes: 1 addition & 1 deletion src/project/load_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func applyLoadOptions(options ...LoadOption) LoadOptions {
opts.WorkingDir += "/"
}
// Check also docker-compose.yaml file
if opts.ComposeFileName == "docker-compose.yml" && fileExists(opts.WorkingDir + "docker-compose.yaml") {
if opts.ComposeFileName == "docker-compose.yml" && fileExists(opts.WorkingDir+"docker-compose.yaml") {
opts.ComposeFileName = "docker-compose.yaml"
}
return opts
Expand Down
2 changes: 1 addition & 1 deletion src/project/save_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func applySaveOptions(options ...SaveOption) SaveOptions {
opts.WorkingDir += "/"
}
// Check also docker-compose.yaml file
if opts.ComposeFileName == "docker-compose.yml" && fileExists(opts.WorkingDir + "docker-compose.yaml") {
if opts.ComposeFileName == "docker-compose.yml" && fileExists(opts.WorkingDir+"docker-compose.yaml") {
opts.ComposeFileName = "docker-compose.yaml"
}
return opts
Expand Down
10 changes: 5 additions & 5 deletions src/util/questions.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ func MenuQuestionWithDefault(label string, items []string, defaultItem string) (
// MenuQuestionIndex prints a selection of predefined items and returns the selected index
func MenuQuestionIndex(label string, items []string) (result int) {
prompt := &survey.Select{
Message: label,
Options: items,
Message: label,
Options: items,
PageSize: 20,
}
handleInterrupt(survey.AskOne(prompt, &result))
Expand All @@ -127,10 +127,10 @@ func MenuQuestionIndex(label string, items []string) (result int) {
// MenuQuestionIndexWithDefault prints a selection of predefined items and returns the selected index
func MenuQuestionIndexWithDefault(label string, items []string, defaultItem string) (result int) {
prompt := &survey.Select{
Message: label,
Options: items,
Message: label,
Options: items,
PageSize: 20,
Default: defaultItem,
Default: defaultItem,
}
handleInterrupt(survey.AskOne(prompt, &result))
return
Expand Down

0 comments on commit 9d151d9

Please sign in to comment.