Skip to content

Commit

Permalink
Merge pull request concourse#4651 from concourse/smol-style-changes
Browse files Browse the repository at this point in the history
Small style fixes and remove an unused constant
  • Loading branch information
vito authored Oct 30, 2019
2 parents 0fb7b3b + 60b621e commit 27db3ef
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
1 change: 0 additions & 1 deletion atc/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
)

const ConfigVersionHeader = "X-Concourse-Config-Version"
const DefaultPipelineName = "main"
const DefaultTeamName = "main"

// TIMEOUT CONSTANTS
Expand Down
4 changes: 2 additions & 2 deletions atc/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func NewTaskConfig(configBytes []byte) (TaskConfig, error) {
}

func (config TaskConfig) Validate() error {
messages := []string{}
var messages []string

if config.Platform == "" {
messages = append(messages, " missing 'platform'")
Expand All @@ -88,7 +88,7 @@ func (config TaskConfig) Validate() error {
}

func (config TaskConfig) validateOutputContainsNames() []string {
messages := []string{}
var messages []string

for i, output := range config.Outputs {
if output.Name == "" {
Expand Down
22 changes: 11 additions & 11 deletions atc/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ type ConfigWarning struct {
}

func (c Config) Validate() ([]ConfigWarning, []string) {
warnings := []ConfigWarning{}
errorMessages := []string{}
var warnings []ConfigWarning
var errorMessages []string

groupsErr := validateGroups(c)
if groupsErr != nil {
Expand All @@ -53,7 +53,7 @@ func (c Config) Validate() ([]ConfigWarning, []string) {
}

func validateGroups(c Config) error {
errorMessages := []string{}
var errorMessages []string

jobsGrouped := make(map[string]bool)
groupNames := make(map[string]int)
Expand Down Expand Up @@ -109,7 +109,7 @@ func validateGroups(c Config) error {
}

func validateResources(c Config) error {
errorMessages := []string{}
var errorMessages []string

names := map[string]int{}

Expand Down Expand Up @@ -145,7 +145,7 @@ func validateResources(c Config) error {
}

func validateResourceTypes(c Config) error {
errorMessages := []string{}
var errorMessages []string

names := map[string]int{}

Expand Down Expand Up @@ -208,8 +208,8 @@ func usedResources(c Config) map[string]bool {
}

func validateJobs(c Config) ([]ConfigWarning, error) {
errorMessages := []string{}
warnings := []ConfigWarning{}
var errorMessages []string
var warnings []ConfigWarning

names := map[string]int{}

Expand Down Expand Up @@ -395,8 +395,8 @@ func validatePlan(c Config, identifier string, plan PlanConfig) ([]ConfigWarning
return []ConfigWarning{}, []string{message}
}

errorMessages := []string{}
warnings := []ConfigWarning{}
var errorMessages []string
var warnings []ConfigWarning

switch {
case plan.Do != nil:
Expand Down Expand Up @@ -626,8 +626,8 @@ func validatePlan(c Config, identifier string, plan PlanConfig) ([]ConfigWarning
}

func validateInapplicableFields(inapplicableFields []string, plan PlanConfig, identifier string) []string {
errorMessages := []string{}
foundInapplicableFields := []string{}
var errorMessages []string
var foundInapplicableFields []string

for _, field := range inapplicableFields {
switch field {
Expand Down

0 comments on commit 27db3ef

Please sign in to comment.