1
0
mirror of https://github.com/golang/go synced 2024-09-30 16:18:35 -06:00
go/cmd/godoc
Dmitri Shuralyov bd17c084df godoc/env: replace with golangorgenv
This change replaces the env package with a new golangorgenv package.

The previous env package existed primarily to configure the godoc
instance that was running golang.org. By now, the golang.org website
has been factored out to x/website, which has its own env package,
but ends up still using this env package indirectly via x/tools/godoc.

The goal of this change is to make env available for other services
that run on subdomains of golang.org, so they can continue to safely
rely on the x/tools/playground, which will be modified in the next
commit to also use the new golangorgenv.

The golangorgenv package replaces the IsProd function with a more
specific one. Start using it in packages x/tools/{,cmd}/godoc. Also,
re-arrange the order of checks to give the host suffix check higher
priority than the environment variable check. This way, if the
environment variable isn't set, the host suffix check gets a chance
to run.

When getting the value of "X-AppEngine-Country" header, use its
canonical format "X-Appengine-Country" to avoid an allocation.
This does not change behavior.

Updates golang/go#30486

Change-Id: I97b47211a45ca0351f31fcb4fa6d408a4b0c4c7c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/165459
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-07 16:39:06 +00:00
..
blog.go cmd/godoc: redirect to https instead of http for blog.golang.org 2018-08-22 02:22:54 +00:00
codewalk.go go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00
dl.go cmd/godoc: remove golang.org serving code 2019-02-20 19:02:57 +00:00
doc.go cmd/godoc: re-add documentation for flat presentation mode 2019-02-19 03:57:21 +00:00
godoc_test.go cmd/godoc,cmd/gorename,refactor/rename: skip tests on GOOS=android 2019-03-06 15:27:20 +00:00
goroot.go cmd/godoc: use same GOROOT discovery as Go 1.10's cmd/go 2018-06-12 01:24:34 +00:00
handlers.go godoc/env: replace with golangorgenv 2019-03-07 16:39:06 +00:00
index.go cmd/godoc: exclude /pkg from search indexing 2015-03-12 00:26:38 +00:00
main.go cmd/godoc: remove golang.org serving code 2019-02-20 19:02:57 +00:00
play.go cmd/godoc: remove golang.org serving code 2019-02-20 19:02:57 +00:00