From 0b15eb0cc87649e42352a827778b8009615c6191 Mon Sep 17 00:00:00 2001 From: mpl Date: Mon, 15 Oct 2012 17:28:07 +0200 Subject: [PATCH] handlers in wizard: swap arguments to match http handlers style Change-Id: I78e9b218392979017682c375ce8a4b636ed3a832 --- pkg/server/wizard.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkg/server/wizard.go b/pkg/server/wizard.go index 666b8438c..9a36e23e7 100644 --- a/pkg/server/wizard.go +++ b/pkg/server/wizard.go @@ -115,8 +115,7 @@ func flattenPublish(config jsonconfig.Obj) error { return nil } -// TODO(mpl): invert args order to respect handler conventien. next CL. -func sendWizard(req *http.Request, rw http.ResponseWriter, hasChanged bool) { +func sendWizard(rw http.ResponseWriter, req *http.Request, hasChanged bool) { config, err := jsonconfig.ReadFile(osutil.UserServerConfigPath()) if err != nil { httputil.ServerError(rw, req, err) @@ -168,8 +167,7 @@ func rewriteConfig(config *jsonconfig.Obj, configfile string) error { return err } -// TODO(mpl): invert args order to respect handler conventien. next CL. -func handleSetupChange(req *http.Request, rw http.ResponseWriter) { +func handleSetupChange(rw http.ResponseWriter, req *http.Request) { hilevelConf, err := jsonconfig.ReadFile(osutil.UserServerConfigPath()) if err != nil { httputil.ServerError(rw, req, err) @@ -242,7 +240,7 @@ func handleSetupChange(req *http.Request, rw http.ResponseWriter) { return } } - sendWizard(req, rw, hasChanged) + sendWizard(rw, req, hasChanged) return } @@ -261,7 +259,7 @@ func (sh *SetupHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request) { return } if len(req.Form) > 0 { - handleSetupChange(req, rw) + handleSetupChange(rw, req) return } if strings.Contains(req.URL.Path, "restartCamli") { @@ -272,5 +270,5 @@ func (sh *SetupHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request) { } } - sendWizard(req, rw, false) + sendWizard(rw, req, false) }