concourse / concourse

Empty slice literal used to declare a variable GO-W1027
Anti-pattern
Minor
5 months agoa year old
Empty slice literal of type "[]containerd.Process" used to define "procs"
158		return nil, fmt.Errorf("pid listing: %w", err)
159	}
160
161	procs := []containerd.Process{}162	for _, pid := range pids {
163		if pid.Info == nil { // init
164			continue
Empty slice literal of type "[]vars.Variables" used to define "staticVars"
274		return atc.Config{}, err
275	}
276
277	staticVars := []vars.Variables{}278	if len(s.step.plan.Vars) > 0 {
279		staticVars = append(staticVars, vars.StaticVariables(s.step.plan.Vars))
280	}
Empty slice literal of type "[]string" used to define "flags"
159func getGdnFlagsFromEnv(logger lager.Logger) []string {
160	env := os.Environ()
161
162	flags := []string{}163	for _, e := range env {
164		spl := strings.SplitN(e, "=", 2)
165		if len(spl) != 2 {
Empty slice literal of type "[]string" used to define "gdnConfigFlag"
 62
 63	members := grouper.Members{}
 64
 65	gdnConfigFlag := []string{} 66
 67	if cmd.Guardian.Config.Path() != "" {
 68		gdnConfigFlag = append(gdnConfigFlag, "--config", cmd.Guardian.Config.Path())
Empty slice literal of type "[]string" used to define "handles"
61	if err != nil {
62		logger.Error("failed-to-list-volumes", err)
63	} else {
64		handles := []string{}65		for _, volume := range volumes {
66			handles = append(handles, volume.Handle())
67		}