Skip to content

Commit

Permalink
cmd/godoc: delete unused autocert hooks
Browse files Browse the repository at this point in the history
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 <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
  • Loading branch information
dmitshur committed Nov 21, 2019
1 parent 66c5a5a commit f51c1a7
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions cmd/godoc/main.go
Expand Up @@ -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".`)
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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
)

0 comments on commit f51c1a7

Please sign in to comment.