superfly / flyctl

Suspicious assignment of range-loop vars RVV-B0008
Bug risk
Major
a month ago3 years old
suspicious assignment of 'mnt'. range-loop variables always have the same address
214				Name:                mnt.Name,
215				Region:              region,
216				SizeGb:              &mnt.SizeGb,
217				Encrypted:           &mnt.Encrypted,218				SnapshotID:          snapshotID,
219				RequireUniqueZone:   fly.Pointer(flag.GetBool(ctx, "volume-requires-unique-zone")),
220				ComputeRequirements: targetConfig.Guest,
suspicious assignment of 'mnt'. range-loop variables always have the same address
213			volInput := fly.CreateVolumeRequest{
214				Name:                mnt.Name,
215				Region:              region,
216				SizeGb:              &mnt.SizeGb,217				Encrypted:           &mnt.Encrypted,
218				SnapshotID:          snapshotID,
219				RequireUniqueZone:   fly.Pointer(flag.GetBool(ctx, "volume-requires-unique-zone")),
suspicious assignment of 'cav'. range-loop variables always have the same address
436		if orgID != nil {
437			return errors.New("multiple org caveats")
438		}
439		orgID = &cav.ID440	}
441	if orgID == nil {
442		return errors.New("no org caveats")