diff --git a/go.mod b/go.mod index ae64a4ddf020b5457ac5a9d6d4978b13c72660bf..466e45868da20c02aa95e7d3e302f4ede0f74e26 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,10 @@ module acme-web -go 1.17 - -require github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 +go 1.18 require ( - github.com/gorilla/mux v1.8.0 // indirect - gopkg.in/ini.v1 v1.67.0 // indirect + github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 + gopkg.in/ini.v1 v1.67.0 ) + +require github.com/stretchr/testify v1.8.0 // indirect diff --git a/go.sum b/go.sum index cbc4f0ab33e88133e71806a0bda7c7351a932a2c..c96f08c031ec7ca7f14d855324dd8f6dff7cf491 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,18 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/main.go b/main.go index f0e605535b030d07ace27490d8395e8ae970891e..c9508d10b4c7faafe56d8d4e7f325ca9acab8538 100644 --- a/main.go +++ b/main.go @@ -10,7 +10,6 @@ import ( "strings" "github.com/docopt/docopt-go" - "github.com/gorilla/mux" "gopkg.in/ini.v1" ) @@ -104,11 +103,6 @@ func redirect(w http.ResponseWriter, req *http.Request) { http.Redirect(w, req, redirectURL, http.StatusMovedPermanently) } -// throw 404 -func throwNotFound(w http.ResponseWriter, req *http.Request) { - http.NotFound(w, req) -} - func main() { progName := filepath.Base(os.Args[0]) @@ -184,9 +178,6 @@ Options: http.HandleFunc(otherElement, renderPage) } - rtr := mux.NewRouter() - rtr.HandleFunc("/number/{.+}", throwNotFound) - if listenAddress == "any" { log.Fatal(http.ListenAndServe(fmt.Sprintf(":%v", listenPort), nil)) } else {