1
0
mirror of https://github.com/golang/go synced 2024-11-18 10:04:43 -07:00

cmd/godoc: delete unused autocert hooks

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>
This commit is contained in:
Dmitri Shuralyov 2019-11-20 23:46:42 -05:00
parent 66c5a5ad76
commit f51c1a7cd2

View File

@ -159,10 +159,6 @@ func main() {
flag.Usage = usage flag.Usage = usage
flag.Parse() flag.Parse()
if certInit != nil {
certInit()
}
// Check usage. // Check usage.
if flag.NArg() > 0 { 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".`) 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) 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. // Start http server.
if *verbose { if *verbose {
log.Println("starting HTTP server") log.Println("starting HTTP server")
} }
if wrapHTTPMux != nil {
handler = wrapHTTPMux(handler)
}
if err := http.ListenAndServe(*httpAddr, handler); err != nil { if err := http.ListenAndServe(*httpAddr, handler); err != nil {
log.Fatalf("ListenAndServe %s: %v", *httpAddr, err) 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() + ")" } 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
)