diff --git a/cmd/golangorg/appinit.go b/cmd/golangorg/appinit.go index 5485194c..24a47e79 100644 --- a/cmd/golangorg/appinit.go +++ b/cmd/golangorg/appinit.go @@ -75,10 +75,11 @@ func main() { fs.Bind("/", rootfs, "/", vfs.BindReplace) } - // Use a local copy of root.html instead of the one in the main go repository. - // See golang.org/issue/29206 for more info. - fs.Bind("/doc/root.html", mapfs.New(static.Files), "/doc/root.html", vfs.BindReplace) - fs.Bind("/doc/copyright.html", mapfs.New(static.Files), "/doc/copyright.html", vfs.BindReplace) + // Try serving files in /doc from a local copy before trying the main + // go repository. This lets us update some documentation outside the + // Go release cycle. This includes root.html, which redirects to "/". + // See golang.org/issue/29206. + fs.Bind("/doc", mapfs.New(static.Files), "/doc", vfs.BindBefore) fs.Bind("/lib/godoc", mapfs.New(static.Files), "/", vfs.BindReplace) webroot := getFullPath("/src/golang.org/x/website") diff --git a/cmd/golangorg/main.go b/cmd/golangorg/main.go index 1044f7ff..3c825a22 100644 --- a/cmd/golangorg/main.go +++ b/cmd/golangorg/main.go @@ -7,7 +7,7 @@ // Web server tree: // // https://golang.org/ main landing page -// https://golang.org/doc/ serve from $GOROOT/doc - spec, mem, etc. +// https://golang.org/doc/ serve from content/static/doc, then $GOROOT/doc. spec, mem, etc. // https://golang.org/src/ serve files from $GOROOT/src; .go gets pretty-printed // https://golang.org/cmd/ serve documentation about commands // https://golang.org/pkg/ serve documentation about packages @@ -15,8 +15,8 @@ // https://golang.org/pkg/compress/zlib) // -// Some pages are being transitioned from $GOROOT to this source tree. -// See bindings below to see which ones. +// Some pages are being transitioned from $GOROOT to content/static/doc. +// See golang.org/issue/29206 and golang.org/issue/33637. // +build !golangorg @@ -143,15 +143,15 @@ func main() { defer rc.Close() // be nice (e.g., -writeIndex mode) fs.Bind("/", zipfs.New(rc, *zipfile), *goroot, vfs.BindReplace) } - // Use a local copy of root.html instead of the one in the main go repository. - // See golang.org/issue/29206 for more info. + // Try serving files in /doc from a local copy before trying the main + // go repository. This lets us update some documentation outside the + // Go release cycle. This includes root.html, which redirects to "/". + // See golang.org/issue/29206. if *templateDir != "" { - fs.Bind("/doc/root.html", vfs.OS(*templateDir), "/doc/root.html", vfs.BindReplace) - fs.Bind("/doc/copyright.html", vfs.OS(*templateDir), "/doc/copyright.html", vfs.BindReplace) + fs.Bind("/doc", vfs.OS(*templateDir), "/doc", vfs.BindBefore) fs.Bind("/lib/godoc", vfs.OS(*templateDir), "/", vfs.BindBefore) } else { - fs.Bind("/doc/root.html", mapfs.New(static.Files), "/doc/root.html", vfs.BindReplace) - fs.Bind("/doc/copyright.html", mapfs.New(static.Files), "/doc/copyright.html", vfs.BindReplace) + fs.Bind("/doc", mapfs.New(static.Files), "/doc", vfs.BindBefore) fs.Bind("/lib/godoc", mapfs.New(static.Files), "/", vfs.BindReplace) } diff --git a/content/static/doc/docs.html b/content/static/doc/docs.html new file mode 100644 index 00000000..8f79d3a7 --- /dev/null +++ b/content/static/doc/docs.html @@ -0,0 +1,232 @@ + + +
+The Go programming language is an open source project to make programmers more +productive. +
+ ++Go is expressive, concise, clean, and efficient. Its concurrency +mechanisms make it easy to write programs that get the most out of multicore +and networked machines, while its novel type system enables flexible and +modular program construction. Go compiles quickly to machine code yet has the +convenience of garbage collection and the power of run-time reflection. It's a +fast, statically typed, compiled language that feels like a dynamically typed, +interpreted language. +
+ + + ++Instructions for downloading and installing the Go compilers, tools, and +libraries. +
+ + ++An interactive introduction to Go in three sections. +The first section covers basic syntax and data structures; the second discusses +methods and interfaces; and the third introduces Go's concurrency primitives. +Each section concludes with a few exercises so you can practice what you've +learned. You can {{if not $.GoogleCN}}take the tour +online or{{end}} install it locally with: +
++$ go get golang.org/x/tour ++
+This will place the tour
binary in your workspace's bin
directory.
+
+{{if not $.GoogleCN}} +Also available as a screencast, this +{{else}} +This +{{end}} +doc explains how to use the go command +to fetch, build, and install packages, commands, and run tests. +
+ ++A document that summarizes commonly used editor plugins and IDEs with +Go support. +
+ ++A document that gives tips for writing clear, idiomatic Go code. +A must read for any new Go programmer. It augments the tour and +the language specification, both of which should be read first. +
+ ++Summarizes tools and methodologies to diagnose problems in Go programs. +
+ ++Answers to common questions about Go. +
+ +A wiki maintained by the Go community.
+ ++See the Learn page at the Wiki +for more Go learning resources. +
+ + ++The documentation for the Go standard library. +
+ ++The documentation for the Go tools. +
+ ++The official Go Language specification. +
+ ++A document that specifies the conditions under which reads of a variable in +one goroutine can be guaranteed to observe values produced by writes to the +same variable in a different goroutine. +
+ +A summary of the changes between Go releases.
+ + +The official blog of the Go project, featuring news and in-depth articles by +the Go team and guests.
+{{end}} + ++Guided tours of Go programs. +
++See the Articles page at the +Wiki for more Go articles. +
+ +{{if not $.GoogleCN}} ++Three things that make Go fast, fun, and productive: +interfaces, reflection, and concurrency. Builds a toy web crawler to +demonstrate these. +
+ ++One of Go's key design goals is code adaptability; that it should be easy to take a simple design and build upon it in a clean and natural way. In this talk Andrew Gerrand describes a simple "chat roulette" server that matches pairs of incoming TCP connections, and then use Go's concurrency mechanisms, interfaces, and standard library to extend it with a web interface and other features. While the function of the program changes dramatically, Go's flexibility preserves the original design as it grows. +
+ ++Concurrency is the key to designing high performance network services. Go's concurrency primitives (goroutines and channels) provide a simple and efficient means of expressing concurrent execution. In this talk we see how tricky concurrency problems can be solved gracefully with simple Go code. +
+ ++This talk expands on the Go Concurrency Patterns talk to dive deeper into Go's concurrency primitives. +
+ ++See the Go Talks site and wiki page for more Go talks. +
+{{end}} + ++See the NonEnglish page +at the Wiki for localized +documentation. +
diff --git a/content/static/gen.go b/content/static/gen.go index 607bb61d..1bfef4ce 100644 --- a/content/static/gen.go +++ b/content/static/gen.go @@ -36,6 +36,7 @@ var files = []string{ "codewalkdir.html", "dirlist.html", "doc/copyright.html", + "doc/docs.html", "doc/root.html", "error.html", "example.html", diff --git a/content/static/static.go b/content/static/static.go index e33cd018..a135f161 100644 --- a/content/static/static.go +++ b/content/static/static.go @@ -47,6 +47,8 @@ var Files = map[string]string{ "doc/copyright.html": "\x0a\x0a\x0a\x20\x20Except\x20as\x0a\x20\x20noted,\x20the\x20contents\x20of\x20this\x0a\x20\x20site\x20are\x20licensed\x20under\x20the\x0a\x20\x20Creative\x20Commons\x20Attribution\x203.0\x20License,\x0a\x20\x20and\x20code\x20is\x20licensed\x20under\x20a\x20BSD\x20license.\x0a
\x0a", + "doc/docs.html": "\x0a\x0a\x0aThe\x20Go\x20programming\x20language\x20is\x20an\x20open\x20source\x20project\x20to\x20make\x20programmers\x20more\x0aproductive.\x0a
\x0a\x0a\x0aGo\x20is\x20expressive,\x20concise,\x20clean,\x20and\x20efficient.\x20Its\x20concurrency\x0amechanisms\x20make\x20it\x20easy\x20to\x20write\x20programs\x20that\x20get\x20the\x20most\x20out\x20of\x20multicore\x0aand\x20networked\x20machines,\x20while\x20its\x20novel\x20type\x20system\x20enables\x20flexible\x20and\x0amodular\x20program\x20construction.\x20Go\x20compiles\x20quickly\x20to\x20machine\x20code\x20yet\x20has\x20the\x0aconvenience\x20of\x20garbage\x20collection\x20and\x20the\x20power\x20of\x20run-time\x20reflection.\x20It's\x20a\x0afast,\x20statically\x20typed,\x20compiled\x20language\x20that\x20feels\x20like\x20a\x20dynamically\x20typed,\x0ainterpreted\x20language.\x0a
\x0a\x0a\x0a\x0a\x0aInstructions\x20for\x20downloading\x20and\x20installing\x20the\x20Go\x20compilers,\x20tools,\x20and\x0alibraries.\x0a
\x0a\x0a\x0a\x0aAn\x20interactive\x20introduction\x20to\x20Go\x20in\x20three\x20sections.\x0aThe\x20first\x20section\x20covers\x20basic\x20syntax\x20and\x20data\x20structures;\x20the\x20second\x20discusses\x0amethods\x20and\x20interfaces;\x20and\x20the\x20third\x20introduces\x20Go's\x20concurrency\x20primitives.\x0aEach\x20section\x20concludes\x20with\x20a\x20few\x20exercises\x20so\x20you\x20can\x20practice\x20what\x20you've\x0alearned.\x20You\x20can\x20{{if\x20not\x20$.GoogleCN}}take\x20the\x20tour\x0aonline\x20or{{end}}\x20install\x20it\x20locally\x20with:\x0a
\x0a\x0a$\x20go\x20get\x20golang.org/x/tour\x0a\x0a
\x0aThis\x20will\x20place\x20the\x20tour
\x20binary\x20in\x20your\x20workspace's\x20bin
\x20directory.\x0a
\x0a{{if\x20not\x20$.GoogleCN}}\x0aAlso\x20available\x20as\x20a\x20screencast,\x20this\x0a{{else}}\x0aThis\x0a{{end}}\x0adoc\x20explains\x20how\x20to\x20use\x20the\x20go\x20command\x0ato\x20fetch,\x20build,\x20and\x20install\x20packages,\x20commands,\x20and\x20run\x20tests.\x0a
\x0a\x0a\x0aA\x20document\x20that\x20summarizes\x20commonly\x20used\x20editor\x20plugins\x20and\x20IDEs\x20with\x0aGo\x20support.\x0a
\x0a\x0a\x0aA\x20document\x20that\x20gives\x20tips\x20for\x20writing\x20clear,\x20idiomatic\x20Go\x20code.\x0aA\x20must\x20read\x20for\x20any\x20new\x20Go\x20programmer.\x20It\x20augments\x20the\x20tour\x20and\x0athe\x20language\x20specification,\x20both\x20of\x20which\x20should\x20be\x20read\x20first.\x0a
\x0a\x0a\x0aSummarizes\x20tools\x20and\x20methodologies\x20to\x20diagnose\x20problems\x20in\x20Go\x20programs.\x0a
\x0a\x0a\x0aAnswers\x20to\x20common\x20questions\x20about\x20Go.\x0a
\x0a\x0aA\x20wiki\x20maintained\x20by\x20the\x20Go\x20community.
\x0a\x0a\x0aSee\x20the\x20Learn\x20page\x20at\x20the\x20Wiki\x0afor\x20more\x20Go\x20learning\x20resources.\x0a
\x0a\x0a\x0a\x0aThe\x20documentation\x20for\x20the\x20Go\x20standard\x20library.\x0a
\x0a\x0a\x0aThe\x20documentation\x20for\x20the\x20Go\x20tools.\x0a
\x0a\x0a\x0aThe\x20official\x20Go\x20Language\x20specification.\x0a
\x0a\x0a\x0aA\x20document\x20that\x20specifies\x20the\x20conditions\x20under\x20which\x20reads\x20of\x20a\x20variable\x20in\x0aone\x20goroutine\x20can\x20be\x20guaranteed\x20to\x20observe\x20values\x20produced\x20by\x20writes\x20to\x20the\x0asame\x20variable\x20in\x20a\x20different\x20goroutine.\x0a
\x0a\x0aA\x20summary\x20of\x20the\x20changes\x20between\x20Go\x20releases.
\x0a\x0a\x0aThe\x20official\x20blog\x20of\x20the\x20Go\x20project,\x20featuring\x20news\x20and\x20in-depth\x20articles\x20by\x0athe\x20Go\x20team\x20and\x20guests.
\x0a{{end}}\x0a\x0a\x0aGuided\x20tours\x20of\x20Go\x20programs.\x0a
\x0a\x0aSee\x20the\x20Articles\x20page\x20at\x20the\x0aWiki\x20for\x20more\x20Go\x20articles.\x0a
\x0a\x0a{{if\x20not\x20$.GoogleCN}}\x0a\x0aThree\x20things\x20that\x20make\x20Go\x20fast,\x20fun,\x20and\x20productive:\x0ainterfaces,\x20reflection,\x20and\x20concurrency.\x20Builds\x20a\x20toy\x20web\x20crawler\x20to\x0ademonstrate\x20these.\x0a
\x0a\x0a\x0aOne\x20of\x20Go's\x20key\x20design\x20goals\x20is\x20code\x20adaptability;\x20that\x20it\x20should\x20be\x20easy\x20to\x20take\x20a\x20simple\x20design\x20and\x20build\x20upon\x20it\x20in\x20a\x20clean\x20and\x20natural\x20way.\x20In\x20this\x20talk\x20Andrew\x20Gerrand\x20describes\x20a\x20simple\x20\"chat\x20roulette\"\x20server\x20that\x20matches\x20pairs\x20of\x20incoming\x20TCP\x20connections,\x20and\x20then\x20use\x20Go's\x20concurrency\x20mechanisms,\x20interfaces,\x20and\x20standard\x20library\x20to\x20extend\x20it\x20with\x20a\x20web\x20interface\x20and\x20other\x20features.\x20While\x20the\x20function\x20of\x20the\x20program\x20changes\x20dramatically,\x20Go's\x20flexibility\x20preserves\x20the\x20original\x20design\x20as\x20it\x20grows.\x0a
\x0a\x0a\x0aConcurrency\x20is\x20the\x20key\x20to\x20designing\x20high\x20performance\x20network\x20services.\x20Go's\x20concurrency\x20primitives\x20(goroutines\x20and\x20channels)\x20provide\x20a\x20simple\x20and\x20efficient\x20means\x20of\x20expressing\x20concurrent\x20execution.\x20In\x20this\x20talk\x20we\x20see\x20how\x20tricky\x20concurrency\x20problems\x20can\x20be\x20solved\x20gracefully\x20with\x20simple\x20Go\x20code.\x0a
\x0a\x0a\x0aThis\x20talk\x20expands\x20on\x20the\x20Go\x20Concurrency\x20Patterns\x20talk\x20to\x20dive\x20deeper\x20into\x20Go's\x20concurrency\x20primitives.\x0a
\x0a\x0a\x0aSee\x20the\x20Go\x20Talks\x20site\x20and\x20wiki\x20page\x20for\x20more\x20Go\x20talks.\x0a
\x0a{{end}}\x0a\x0a\x0aSee\x20the\x20NonEnglish\x20page\x0aat\x20the\x20Wiki\x20for\x20localized\x0adocumentation.\x0a
\x0a", + "doc/root.html": "\x0a\x0a\x0a\x20\x20\x20\x20\x20\x20Binary\x20distributions\x20available\x20for
\x0a\x20\x20\x20\x20\x20\x20Linux,\x20macOS,\x20Windows,\x20and\x20more.\x0a\x20\x20\x20\x20
\x0a{{html\x20.}}\x0a
\x0a", diff --git a/go.mod b/go.mod index 9ee70d38..f1f3f5a4 100644 --- a/go.mod +++ b/go.mod @@ -6,9 +6,8 @@ require ( cloud.google.com/go v0.38.0 github.com/gomodule/redigo v2.0.0+incompatible go.opencensus.io v0.22.0 // indirect - golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 - golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c - golang.org/x/tools v0.0.0-20190516015132-d1a3278ee749 + golang.org/x/net v0.0.0-20190620200207-3b0461eec859 + golang.org/x/tools v0.0.0-20190930201159-7c411dea38b0 google.golang.org/api v0.9.0 // indirect google.golang.org/appengine v1.5.0 ) diff --git a/go.sum b/go.sum index 25d42728..5a5d064e 100644 --- a/go.sum +++ b/go.sum @@ -51,6 +51,8 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c h1:uOCk1iQW6Vc18bnC13MfzScl+wdKBmM9Y9kU7Z83/lw= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= @@ -79,8 +81,9 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190516015132-d1a3278ee749 h1:L1RW4r06KGFktOvNizsWNBWHn4V2I/p9SNRLhNn6hzM= -golang.org/x/tools v0.0.0-20190516015132-d1a3278ee749/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190930201159-7c411dea38b0 h1:7+F62GGWUowoiJOUDivedlBECd/fTeUDJnCu0JetQO0= +golang.org/x/tools v0.0.0-20190930201159-7c411dea38b0/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.9.0 h1:jbyannxz0XFD3zdjgrSUsaJbgpH4eTrkdhRChkHPfO8= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=