From 9be91431553ae20c37210d55be80cd4740a4c4e6 Mon Sep 17 00:00:00 2001 From: Ondrej Kokes Date: Thu, 8 Feb 2024 14:10:21 +0100 Subject: [PATCH] reorder --- cloud/linode/fake_linode_test.go | 40 ++++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/cloud/linode/fake_linode_test.go b/cloud/linode/fake_linode_test.go index c5139e47..5bf94c12 100644 --- a/cloud/linode/fake_linode_test.go +++ b/cloud/linode/fake_linode_test.go @@ -251,26 +251,6 @@ func (f *fakeAPI) setupRoutes() { } }) - f.mux.HandleFunc("DELETE /v4/nodebalancers/{nodeBalancerId}", func(w http.ResponseWriter, r *http.Request) { - delete(f.nb, r.PathValue("nodeBalancerId")) - nid, err := strconv.Atoi(r.PathValue("nodeBalancerId")) - if err != nil { - f.t.Fatal(err) - } - - for k, c := range f.nbc { - if c.NodeBalancerID == nid { - delete(f.nbc, k) - } - } - - for k, n := range f.nbn { - if n.NodeBalancerID == nid { - delete(f.nbn, k) - } - } - }) - f.mux.HandleFunc("POST /v4/nodebalancers", func(w http.ResponseWriter, r *http.Request) { nbco := linodego.NodeBalancerCreateOptions{} if err := json.NewDecoder(r.Body).Decode(&nbco); err != nil { @@ -505,6 +485,26 @@ func (f *fakeAPI) setupRoutes() { _, _ = w.Write(resp) }) + f.mux.HandleFunc("DELETE /v4/nodebalancers/{nodeBalancerId}", func(w http.ResponseWriter, r *http.Request) { + delete(f.nb, r.PathValue("nodeBalancerId")) + nid, err := strconv.Atoi(r.PathValue("nodeBalancerId")) + if err != nil { + f.t.Fatal(err) + } + + for k, c := range f.nbc { + if c.NodeBalancerID == nid { + delete(f.nbc, k) + } + } + + for k, n := range f.nbn { + if n.NodeBalancerID == nid { + delete(f.nbn, k) + } + } + }) + f.mux.HandleFunc("DELETE /v4/nodebalancers/{nodeBalancerId}/configs/{configId}/nodes/{nodeId}", func(w http.ResponseWriter, r *http.Request) { delete(f.nbn, r.PathValue("nodeId")) })