diff --git a/api/client.go b/api/client.go index 16d6be1c59..e20f22ce6e 100644 --- a/api/client.go +++ b/api/client.go @@ -9,12 +9,12 @@ import ( "net/http" "os" "regexp" + "slices" "strings" "time" genq "github.com/Khan/genqlient/graphql" "github.com/superfly/graphql" - "golang.org/x/exp/slices" ) var ( diff --git a/api/go.mod b/api/go.mod index aefa1cab8e..dc6396a2ea 100644 --- a/api/go.mod +++ b/api/go.mod @@ -7,7 +7,6 @@ require ( github.com/PuerkitoBio/rehttp v1.2.0 github.com/superfly/graphql v0.2.4 golang.org/x/crypto v0.12.0 - golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 ) require ( diff --git a/api/go.sum b/api/go.sum index 66605dc901..ccf13c509e 100644 --- a/api/go.sum +++ b/api/go.sum @@ -35,8 +35,6 @@ github.com/vektah/gqlparser/v2 v2.5.1 h1:ZGu+bquAY23jsxDRcYpWjttRZrUz07LbiY77gUO github.com/vektah/gqlparser/v2 v2.5.1/go.mod h1:mPgqFBu/woKTVYWyNk8cO3kh4S/f4aRFZrvOnp3hmCs= golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 h1:MGwJjxBy0HJshjDNfLsYO8xppfqWlA5ZT9OhtUUhTNw= -golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= diff --git a/cmd/audit/lint.go b/cmd/audit/lint.go index 568af76a6e..243b2279c3 100644 --- a/cmd/audit/lint.go +++ b/cmd/audit/lint.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "os" + "slices" "strings" "unicode" @@ -11,7 +12,6 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/superfly/flyctl/internal/command/root" - "golang.org/x/exp/slices" ) func newLintCmd() *cobra.Command { diff --git a/cmd/audit/list.go b/cmd/audit/list.go index a06b47a4b3..4a5618abc1 100644 --- a/cmd/audit/list.go +++ b/cmd/audit/list.go @@ -2,13 +2,13 @@ package main import ( "os" + "slices" "strconv" "strings" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/superfly/flyctl/internal/command/root" - "golang.org/x/exp/slices" ) func formatRawText(desc string) string { diff --git a/flaps/flaps_volumes.go b/flaps/flaps_volumes.go index 238172e1d8..335fad2c52 100644 --- a/flaps/flaps_volumes.go +++ b/flaps/flaps_volumes.go @@ -4,10 +4,10 @@ import ( "context" "fmt" "net/http" + "slices" "github.com/samber/lo" "github.com/superfly/flyctl/api" - "golang.org/x/exp/slices" ) var destroyedVolumeStates = []string{"scheduling_destroy", "fork_cleanup", "waiting_for_detach", "pending_destroy", "destroying"} diff --git a/go.mod b/go.mod index 0ab9de33c1..4f9c9f3a7e 100644 --- a/go.mod +++ b/go.mod @@ -61,7 +61,7 @@ require ( github.com/vektah/gqlparser v1.3.1 github.com/vektah/gqlparser/v2 v2.5.6 golang.org/x/crypto v0.12.0 - golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 + golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 golang.org/x/net v0.14.0 golang.org/x/sync v0.3.0 golang.org/x/term v0.11.0 @@ -150,7 +150,7 @@ require ( github.com/xanzy/ssh-agent v0.3.3 // indirect go.opentelemetry.io/otel/metric v0.37.0 // indirect golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect - golang.org/x/tools v0.9.3 // indirect + golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 // indirect golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20230803162519-f966b187b2e5 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230803162519-f966b187b2e5 // indirect diff --git a/go.sum b/go.sum index 1a7f5ba748..e762cc6041 100644 --- a/go.sum +++ b/go.sum @@ -813,8 +813,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 h1:MGwJjxBy0HJshjDNfLsYO8xppfqWlA5ZT9OhtUUhTNw= -golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 h1:m64FZMko/V45gv0bNmrNYoDEq8U5YUhetc9cBWKS1TQ= +golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63/go.mod h1:0v4NqG35kSWCMzLaMeX+IQrlSnVE/bqGSyC2cz/9Le8= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1059,8 +1059,8 @@ golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM= -golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 h1:Vve/L0v7CXXuxUmaMGIEK/dEeq7uiqb5qBgQrZzIE7E= +golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/internal/appconfig/config.go b/internal/appconfig/config.go index a37b509891..13f33a4a24 100644 --- a/internal/appconfig/config.go +++ b/internal/appconfig/config.go @@ -8,11 +8,11 @@ import ( "net/url" "os" "reflect" + "slices" "github.com/superfly/flyctl/api" "github.com/superfly/flyctl/internal/machine" "github.com/superfly/flyctl/scanner" - "golang.org/x/exp/slices" ) const ( diff --git a/internal/appconfig/processgroups.go b/internal/appconfig/processgroups.go index 703c5598d1..62bfa019c2 100644 --- a/internal/appconfig/processgroups.go +++ b/internal/appconfig/processgroups.go @@ -2,13 +2,13 @@ package appconfig import ( "fmt" + "slices" "strings" "github.com/google/shlex" "github.com/samber/lo" "github.com/superfly/flyctl/api" "github.com/superfly/flyctl/helpers" - "golang.org/x/exp/slices" ) // ProcessNames lists each key of c.Processes, sorted lexicographically diff --git a/internal/appconfig/toplevelcheck.go b/internal/appconfig/toplevelcheck.go index f48e143672..8077a0d6cc 100644 --- a/internal/appconfig/toplevelcheck.go +++ b/internal/appconfig/toplevelcheck.go @@ -2,12 +2,12 @@ package appconfig import ( "fmt" + "slices" "strings" "github.com/samber/lo" "github.com/superfly/flyctl/api" "github.com/superfly/flyctl/internal/sentry" - "golang.org/x/exp/slices" ) type ToplevelCheck struct { diff --git a/internal/appconfig/validation.go b/internal/appconfig/validation.go index 12ab95e8ac..45c67c6bce 100644 --- a/internal/appconfig/validation.go +++ b/internal/appconfig/validation.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "slices" "strings" "time" @@ -12,7 +13,6 @@ import ( "github.com/superfly/flyctl/api" "github.com/superfly/flyctl/client" "github.com/superfly/flyctl/internal/sentry" - "golang.org/x/exp/slices" ) var ( diff --git a/internal/command/deploy/machines_deploymachinesapp.go b/internal/command/deploy/machines_deploymachinesapp.go index e4b1be580c..a9ac36da7e 100644 --- a/internal/command/deploy/machines_deploymachinesapp.go +++ b/internal/command/deploy/machines_deploymachinesapp.go @@ -6,6 +6,7 @@ import ( "fmt" "math" "net" + "slices" "strconv" "strings" "time" @@ -18,7 +19,6 @@ import ( "github.com/superfly/flyctl/internal/machine" "github.com/superfly/flyctl/terminal" "golang.org/x/exp/maps" - "golang.org/x/exp/slices" ) type ProcessGroupsDiff struct { diff --git a/internal/command/extensions/core/core.go b/internal/command/extensions/core/core.go index 0530eaa5c4..047dff37a0 100644 --- a/internal/command/extensions/core/core.go +++ b/internal/command/extensions/core/core.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "path/filepath" + "slices" "time" "github.com/briandowns/spinner" @@ -16,7 +17,6 @@ import ( "github.com/superfly/flyctl/internal/prompt" "github.com/superfly/flyctl/iostreams" "github.com/superfly/flyctl/scanner" - "golang.org/x/exp/slices" ) type Extension struct { diff --git a/internal/command/launch/legacy/launch.go b/internal/command/launch/legacy/launch.go index 0aabda6dae..d071eedce2 100644 --- a/internal/command/launch/legacy/launch.go +++ b/internal/command/launch/legacy/launch.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "path/filepath" + "slices" "strings" "github.com/logrusorgru/aurora" @@ -21,7 +22,6 @@ import ( "github.com/superfly/flyctl/iostreams" "github.com/superfly/flyctl/scanner" "github.com/superfly/graphql" - "golang.org/x/exp/slices" ) func Run(ctx context.Context) (err error) { diff --git a/internal/command/machine/clone.go b/internal/command/machine/clone.go index a95c49a9bf..deb6d7c4d0 100644 --- a/internal/command/machine/clone.go +++ b/internal/command/machine/clone.go @@ -3,6 +3,7 @@ package machine import ( "context" "fmt" + "slices" "strings" "time" @@ -20,7 +21,6 @@ import ( "github.com/superfly/flyctl/internal/watch" "github.com/superfly/flyctl/iostreams" "github.com/superfly/flyctl/terminal" - "golang.org/x/exp/slices" ) func newClone() *cobra.Command { diff --git a/internal/command/machine/run.go b/internal/command/machine/run.go index 258660a90d..4045823520 100644 --- a/internal/command/machine/run.go +++ b/internal/command/machine/run.go @@ -7,6 +7,7 @@ import ( "os" "path" "path/filepath" + "slices" "strconv" "strings" "time" @@ -17,7 +18,6 @@ import ( "github.com/pkg/errors" "github.com/samber/lo" "github.com/spf13/cobra" - "golang.org/x/exp/slices" "github.com/superfly/flyctl/api" "github.com/superfly/flyctl/flaps" diff --git a/internal/command/migrate_to_v2/migrate_to_v2.go b/internal/command/migrate_to_v2/migrate_to_v2.go index 1edab44fc0..7b26a4bdee 100644 --- a/internal/command/migrate_to_v2/migrate_to_v2.go +++ b/internal/command/migrate_to_v2/migrate_to_v2.go @@ -1,9 +1,11 @@ package migrate_to_v2 import ( + "cmp" "context" "errors" "fmt" + "slices" "strings" "time" @@ -32,7 +34,6 @@ import ( "github.com/superfly/flyctl/iostreams" "github.com/superfly/flyctl/terminal" "golang.org/x/exp/maps" - "golang.org/x/exp/slices" ) const defaultWaitTimeout = 5 * time.Minute @@ -283,9 +284,10 @@ func NewV2PlatformMigrator(ctx context.Context, appName string) (V2PlatformMigra } // sort allocs by version descending - slices.SortFunc(allocs, func(i, j *api.AllocationStatus) bool { - return i.Version > j.Version + slices.SortFunc(allocs, func(i, j *api.AllocationStatus) int { + return cmp.Compare(i.Version, j.Version) }) + slices.Reverse(allocs) var highestVersion int allocs = lo.Filter(allocs, func(alloc *api.AllocationStatus, _ int) bool { diff --git a/internal/command/migrate_to_v2/volumes.go b/internal/command/migrate_to_v2/volumes.go index 2c1577dd48..7e759a0789 100644 --- a/internal/command/migrate_to_v2/volumes.go +++ b/internal/command/migrate_to_v2/volumes.go @@ -3,12 +3,12 @@ package migrate_to_v2 import ( "context" "fmt" + "slices" "strings" "github.com/samber/lo" "github.com/superfly/flyctl/api" "github.com/superfly/flyctl/internal/appconfig" - "golang.org/x/exp/slices" ) func (m *v2PlatformMigrator) validateVolumes(ctx context.Context) error { diff --git a/internal/command/regions/nomad.go b/internal/command/regions/nomad.go index 87df088096..01b50f1a49 100644 --- a/internal/command/regions/nomad.go +++ b/internal/command/regions/nomad.go @@ -3,6 +3,7 @@ package regions import ( "context" "fmt" + "slices" "github.com/superfly/flyctl/client" "github.com/superfly/flyctl/internal/appconfig" @@ -10,7 +11,6 @@ import ( "github.com/superfly/flyctl/internal/flag" "github.com/superfly/flyctl/internal/render" "github.com/superfly/flyctl/iostreams" - "golang.org/x/exp/slices" "github.com/superfly/flyctl/api" ) diff --git a/internal/command/scale/count.go b/internal/command/scale/count.go index 4d7c2a5ed7..ea84dc8279 100644 --- a/internal/command/scale/count.go +++ b/internal/command/scale/count.go @@ -3,6 +3,7 @@ package scale import ( "context" "fmt" + "slices" "strconv" "strings" @@ -14,7 +15,6 @@ import ( "github.com/superfly/flyctl/internal/command" "github.com/superfly/flyctl/internal/flag" "github.com/superfly/flyctl/iostreams" - "golang.org/x/exp/slices" ) func newScaleCount() *cobra.Command { diff --git a/internal/command/scale/show_machines.go b/internal/command/scale/show_machines.go index 54058455bc..cf20a64531 100644 --- a/internal/command/scale/show_machines.go +++ b/internal/command/scale/show_machines.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" "fmt" + "slices" "strings" "github.com/samber/lo" @@ -13,7 +14,6 @@ import ( "github.com/superfly/flyctl/internal/flag" "github.com/superfly/flyctl/internal/render" "github.com/superfly/flyctl/iostreams" - "golang.org/x/exp/slices" ) func runMachinesScaleShow(ctx context.Context) error { diff --git a/internal/command/status/machines.go b/internal/command/status/machines.go index 592381c1c4..dd3975ce12 100644 --- a/internal/command/status/machines.go +++ b/internal/command/status/machines.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "io" + "slices" "sort" "strconv" "strings" @@ -15,7 +16,6 @@ import ( "github.com/superfly/flyctl/internal/config" "github.com/superfly/flyctl/internal/render" "github.com/superfly/flyctl/iostreams" - "golang.org/x/exp/slices" ) func getFromMetadata(m *api.Machine, key string) string { diff --git a/internal/flag/completion/completions.go b/internal/flag/completion/completions.go index 833fff4054..dbe7fd2489 100644 --- a/internal/flag/completion/completions.go +++ b/internal/flag/completion/completions.go @@ -3,6 +3,7 @@ package completion import ( "context" "fmt" + "slices" "strings" "github.com/samber/lo" @@ -10,7 +11,6 @@ import ( "github.com/superfly/flyctl/api" "github.com/superfly/flyctl/client" "github.com/superfly/flyctl/internal/flag/flagnames" - "golang.org/x/exp/slices" ) func CompleteApps( diff --git a/internal/flag/context.go b/internal/flag/context.go index f9879d6487..bd276d48cc 100644 --- a/internal/flag/context.go +++ b/internal/flag/context.go @@ -2,13 +2,13 @@ package flag import ( "context" + "slices" "time" "github.com/spf13/pflag" "github.com/superfly/flyctl/internal/env" "github.com/superfly/flyctl/internal/flag/flagctx" "github.com/superfly/flyctl/internal/flag/flagnames" - "golang.org/x/exp/slices" ) // NewContext derives a context that carries fs from ctx. diff --git a/internal/machine/config.go b/internal/machine/config.go index ee32c19ec0..600b452584 100644 --- a/internal/machine/config.go +++ b/internal/machine/config.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "regexp" + "slices" "strings" "github.com/google/go-cmp/cmp" @@ -12,7 +13,6 @@ import ( "github.com/superfly/flyctl/helpers" "github.com/superfly/flyctl/internal/prompt" "github.com/superfly/flyctl/iostreams" - "golang.org/x/exp/slices" ) type ErrNoConfigChangesFound struct{} diff --git a/internal/machine/machine_set.go b/internal/machine/machine_set.go index 311a3f978c..a0fd47bfdc 100644 --- a/internal/machine/machine_set.go +++ b/internal/machine/machine_set.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "slices" "sync" "time" @@ -11,7 +12,6 @@ import ( "github.com/superfly/flyctl/flaps" "github.com/superfly/flyctl/iostreams" "github.com/superfly/flyctl/terminal" - "golang.org/x/exp/slices" ) type MachineSet interface { diff --git a/internal/machine/update.go b/internal/machine/update.go index 1bb611f102..5bd7b1fd27 100644 --- a/internal/machine/update.go +++ b/internal/machine/update.go @@ -3,6 +3,7 @@ package machine import ( "context" "fmt" + "slices" "time" "github.com/superfly/flyctl/api" @@ -10,7 +11,6 @@ import ( "github.com/superfly/flyctl/internal/watch" "github.com/superfly/flyctl/iostreams" "golang.org/x/exp/maps" - "golang.org/x/exp/slices" ) var cpusPerKind = map[string][]int{ diff --git a/test/preflight/fly_machine_test.go b/test/preflight/fly_machine_test.go index 281becb078..b04fa76238 100644 --- a/test/preflight/fly_machine_test.go +++ b/test/preflight/fly_machine_test.go @@ -4,12 +4,12 @@ package preflight import ( + "slices" "testing" "github.com/stretchr/testify/require" "github.com/superfly/flyctl/api" "github.com/superfly/flyctl/test/preflight/testlib" - "golang.org/x/exp/slices" ) // test --port and --autostart --autostop flags diff --git a/test/preflight/testlib/helpers.go b/test/preflight/testlib/helpers.go index abcd3dc7b8..b0afcfb9e3 100644 --- a/test/preflight/testlib/helpers.go +++ b/test/preflight/testlib/helpers.go @@ -16,6 +16,7 @@ import ( "path" "path/filepath" "runtime" + "slices" "strings" "testing" "time" @@ -24,7 +25,6 @@ import ( "github.com/jpillora/backoff" "github.com/superfly/flyctl/iostreams" "github.com/superfly/flyctl/terminal" - "golang.org/x/exp/slices" ) const defaultRegion = "iad"