superfly / flyctl

Empty slice literal used to declare a variable GO-W1027
Anti-pattern
Minor
11 days agoa year old
Empty slice literal of type "[]string" used to define "flagsName"
173
174// GetFlagsName returns the name of flags that have been set except unwanted flags.
175func GetFlagsName(ctx context.Context, ignoreFlags []string) []string {
176	flagsName := []string{}177
178	FromContext(ctx).Visit(func(f *pflag.Flag) {
179		if f.Hidden {
Empty slice literal of type "[]string" used to define "strategies"
252}
253
254func (cfg *Config) BuildStrategies() []string {
255	strategies := []string{}256
257	if cfg == nil || cfg.Build == nil {
258		return strategies
Empty slice literal of type "[]int" used to define "numbers"
804}
805
806func getZombies(ids map[string]bool) (map[string]bool, error) {
807	numbers := []int{}808	for str := range ids {
809		num, err := strconv.Atoi(str)
810		if err != nil {
Empty slice literal of type "[]string" used to define "rows"
182
183	return func() {
184		currentView := map[string]string{}
185		rows := []string{}186		bg.stateLock.RLock()
187		for id, status := range state {
188			currentView[id] = status
Empty slice literal of type "[]*machineUpdateEntry" used to define "nonZombies"
867		fmt.Fprintf(bg.io.ErrOut, "  Zombie Machine %s destroyed [%s]\n", bg.colorize.Bold(mach.leasableMachine.FormattedMachineId()), mach.launchInput.Config.Metadata[fly.MachineConfigMetadataKeyFlyctlBGTag])
868	}
869
870	nonZombies := []*machineUpdateEntry{}871	for _, mach := range bg.blueMachines {
872		tag := mach.launchInput.Config.Metadata[fly.MachineConfigMetadataKeyFlyctlBGTag]
873		if zombies[tag] {