From f51c1a7cd27ac4568d6d17d3c90c892ba90d86e0 Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Wed, 20 Nov 2019 23:46:42 -0500 Subject: [PATCH] cmd/godoc: delete unused autocert hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The autocert.go file in x/tools was deleted in CL 162400, but some related variables were left behind. This change deletes them, since they are unused by now. (If you're feeling déjà vu, it's likely because this was done in x/website in CL 197957.) Updates golang/go#29206 Updates golang/go#32011 Change-Id: I070f711e8bbc7b54f1d169571356fdc24bc00137 Reviewed-on: https://go-review.googlesource.com/c/tools/+/208259 Run-TryBot: Dmitri Shuralyov TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- cmd/godoc/main.go | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/cmd/godoc/main.go b/cmd/godoc/main.go index 77a38ac6f7..48a658e092 100644 --- a/cmd/godoc/main.go +++ b/cmd/godoc/main.go @@ -159,10 +159,6 @@ func main() { flag.Usage = usage flag.Parse() - if certInit != nil { - certInit() - } - // Check usage. if flag.NArg() > 0 { fmt.Fprintln(os.Stderr, `Unexpected arguments. Use "go doc" for command-line help output instead. For example, "go doc fmt.Printf".`) @@ -361,21 +357,10 @@ func main() { go analysis.Run(pointerAnalysis, &corpus.Analysis) } - if runHTTPS != nil { - go func() { - if err := runHTTPS(handler); err != nil { - log.Fatalf("ListenAndServe TLS: %v", err) - } - }() - } - // Start http server. if *verbose { log.Println("starting HTTP server") } - if wrapHTTPMux != nil { - handler = wrapHTTPMux(handler) - } if err := http.ListenAndServe(*httpAddr, handler); err != nil { log.Fatalf("ListenAndServe %s: %v", *httpAddr, err) } @@ -523,11 +508,3 @@ func (moduleFS) RootType(path string) vfs.RootType { } } func (fs moduleFS) String() string { return "module(" + fs.FileSystem.String() + ")" } - -// Hooks that are set non-nil in autocert.go if the "autocert" build tag -// is used. -var ( - certInit func() - runHTTPS func(http.Handler) error - wrapHTTPMux func(http.Handler) http.Handler -)