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 {
252}
253
254func (cfg *Config) BuildStrategies() []string {
255 strategies := []string{}256
257 if cfg == nil || cfg.Build == nil {
258 return strategies
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 {
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
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] {
An empty slice can be represented by nil
or an empty slice literal. They are
functionally equivalent — their len
and cap
are both zero — but the nil
slice is the preferred style. For more information about empty slices,
see Declaring Empty Slices.
package main
func foo() {
a := []int{}
}
package main
func foo() {
var a []int
}