diff options
| author | Russ Cox <rsc@golang.org> | 2021-11-17 22:51:08 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2021-11-22 16:42:59 +0000 |
| commit | 40c0eef09728d0b38f740dfe55031330800b1456 (patch) | |
| tree | 6aef5e319eaf8ba0b3824a679eae62dd40e8bdc2 /cmd/golangorg/server.go | |
| parent | 370a0d0e46fcdb0c463d1ee7344c14ec67c210e2 (diff) | |
| download | go-x-website-40c0eef09728d0b38f740dfe55031330800b1456.tar.xz | |
go.dev: merge go.dev/_content into root _content
Many renames. And then adjust references.
Change-Id: I4d03c76dbc0bf4d070208d568861ee820904c0dc
Reviewed-on: https://go-review.googlesource.com/c/website/+/365097
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Diffstat (limited to 'cmd/golangorg/server.go')
| -rw-r--r-- | cmd/golangorg/server.go | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/cmd/golangorg/server.go b/cmd/golangorg/server.go index b8187298..eec03c54 100644 --- a/cmd/golangorg/server.go +++ b/cmd/golangorg/server.go @@ -135,13 +135,11 @@ func NewHandler(contentDir, goroot string) http.Handler { // Serve files from _content, falling back to GOROOT. // Use explicit contentDir if specified, otherwise embedded copy. - var golangFS, godevFS fs.FS + var contentFS fs.FS if contentDir != "" { - golangFS = os.DirFS(contentDir) - godevFS = os.DirFS(filepath.Join(contentDir, "../go.dev/_content")) + contentFS = os.DirFS(contentDir) } else { - golangFS = website.Golang - godevFS = website.Godev + contentFS = website.Content } var gorootFS fs.FS @@ -157,9 +155,8 @@ func NewHandler(contentDir, goroot string) http.Handler { // tip.golang.org serves content from the very latest Git commit // of the main Go repo, instead of the one the app is bundled with. - // TODO(rsc): The unionFS is a hack until we move the files in a followup CL. var tipGoroot atomicFS - if _, err := newSite(mux, "tip.golang.org", unionFS{godevFS, golangFS}, &tipGoroot); err != nil { + if _, err := newSite(mux, "tip.golang.org", contentFS, &tipGoroot); err != nil { log.Fatalf("loading tip site: %v", err) } if *tipFlag { @@ -187,11 +184,11 @@ func NewHandler(contentDir, goroot string) http.Handler { // TODO(rsc): The unionFS is a hack until we move the files in a followup CL. siteMux := http.NewServeMux() - godevSite, err := newSite(siteMux, "", unionFS{godevFS, golangFS}, gorootFS) + godevSite, err := newSite(siteMux, "", contentFS, gorootFS) if err != nil { log.Fatalf("newSite go.dev: %v", err) } - chinaSite, err := newSite(siteMux, "golang.google.cn", unionFS{godevFS, golangFS}, gorootFS) + chinaSite, err := newSite(siteMux, "golang.google.cn", contentFS, gorootFS) if err != nil { log.Fatalf("newSite golang.google.cn: %v", err) } |
