about summary refs log tree commit diff
path: root/third_party/gerrit-queue/frontend/frontend.go
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-12-10T09·15+0300
committerclbot <clbot@tvl.fyi>2021-12-10T13·09+0000
commit0fa937551e6fa1021dbad4d523e0743fe25a24df (patch)
tree6f8e19d70f1b3633004bda409450d48fb2040ccb /third_party/gerrit-queue/frontend/frontend.go
parent6e4decf19b2b221030df0e3614c579ff3896b25a (diff)
refactor(gerrit-queue): Remove dependency on gin r/3182
Unnecessary dependency & complexity.

(Patch originally contributed by an anonymous contributor)

Change-Id: Id49dc362cb0c1b29937404447bb0b1f9794dc117
Diffstat (limited to 'third_party/gerrit-queue/frontend/frontend.go')
-rw-r--r--third_party/gerrit-queue/frontend/frontend.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/third_party/gerrit-queue/frontend/frontend.go b/third_party/gerrit-queue/frontend/frontend.go
index f1c7857ef87c..f00bc414a1c7 100644
--- a/third_party/gerrit-queue/frontend/frontend.go
+++ b/third_party/gerrit-queue/frontend/frontend.go
@@ -8,7 +8,6 @@ import (
 
 	"html/template"
 
-	"github.com/gin-gonic/gin"
 	"github.com/rakyll/statik/fs"
 
 	"github.com/apex/log"
@@ -51,12 +50,11 @@ func loadTemplate(templateNames []string, funcMap template.FuncMap) (*template.T
 
 // MakeFrontend returns a http.Handler
 func MakeFrontend(rotatingLogHandler *misc.RotatingLogHandler, gerritClient *gerrit.Client, runner *submitqueue.Runner) http.Handler {
-	router := gin.Default()
-
 	projectName := gerritClient.GetProjectName()
 	branchName := gerritClient.GetBranchName()
 
-	router.GET("/", func(c *gin.Context) {
+	mux := http.NewServeMux()
+	mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) {
 		var wipSerie *gerrit.Serie = nil
 		HEAD := ""
 		currentlyRunning := runner.IsCurrentlyRunning()
@@ -99,7 +97,7 @@ func MakeFrontend(rotatingLogHandler *misc.RotatingLogHandler, gerritClient *ger
 			"changeset.tmpl.html",
 		}, funcMap))
 
-		tmpl.ExecuteTemplate(c.Writer, "index.tmpl.html", gin.H{
+		tmpl.ExecuteTemplate(w, "index.tmpl.html", map[string]interface{}{
 			// Config
 			"projectName": projectName,
 			"branchName":  branchName,
@@ -113,5 +111,5 @@ func MakeFrontend(rotatingLogHandler *misc.RotatingLogHandler, gerritClient *ger
 			"memory": rotatingLogHandler,
 		})
 	})
-	return router
+	return mux
 }