aboutsummaryrefslogtreecommitdiff
path: root/_content/doc/code.html
AgeCommit message (Collapse)Author
2023-12-20all: fix and test for references to github.com/golang/go/issues and wikiRuss Cox
Insist on the canonical /issue/ and /wiki/ links instead. Change-Id: I7a2eedda69bc3fcd11466722a41f00c9dbaf283f Reviewed-on: https://go-review.googlesource.com/c/website/+/550323 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-08-03_content: update for golang.org/x/example changesRuss Cox
golang.org/x/example/stringutil.Reverse moved to golang.org/x/example/hello/reverse.String. Update references accordingly. Fixes golang/go#61722. Change-Id: Ib041697bc1c5c40d2b6ccefc7550caaedf338b2d Reviewed-on: https://go-review.googlesource.com/c/website/+/515238 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Russ Cox <rsc@golang.org>
2023-02-14_content: Breadcrumbs added to children pages.Frederick Mixell
Added to all doc children page with doclayout. Added to Why Go pages. Added to Security pages. Video of Changes: https://drive.google.com/file/d/1wX9e9K9H9wPTaLLQHh15-cWzMTMRr9DO/view?usp=sharing Change-Id: I0fbf8e925e7fa357762d8eebd2bf13d561d49d86 Reviewed-on: https://go-review.googlesource.com/c/website/+/432775 Reviewed-by: Jamal Carvalho <jamal@golang.org> Run-TryBot: Jamal Carvalho <jamal@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2022-05-24_content/doc: fix inconsistent tabs in code snippetsGeorge Looshch
Replace real tabs with 4 spaces in code snippets to make indentation consistent Fixes golang/go#52255 Change-Id: Ida06a1dd2c2cd3100c32d6c29febf60aba2e20d7 Reviewed-on: https://go-review.googlesource.com/c/website/+/399374 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2022-01-06_content/doc: fix a link in code.htmlJorge Troncoso
Change the anchor to point to the "Remote import paths" section. Previously the anchor pointed to the "Relative import paths" section, even though the paragraph was about "Remote import paths." Change-Id: I376d5f99149041edcc4d6370522bdfbfe80eceb4 Reviewed-on: https://go-review.googlesource.com/c/website/+/375554 Run-TryBot: Jean de Klerk <deklerk@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Jamal Carvalho <jamalcarvalho@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Trust: Dmitri Shuralyov <dmitshur@google.com>
2021-11-22_content: update links to tourRuss Cox
Now the tour is just /tour, not https://tour.golang.org. Change-Id: Iebb2f7a5218b747896250815f4f46f62755e6a88 Reviewed-on: https://go-review.googlesource.com/c/website/+/365101 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-11-22_content: replace scheme-relative URLs with https://Russ Cox
The time for scheme-relative URLs has passed. go.dev, like all of .dev, is an HTTPS-only domain. And golang.org has set HSTS headers for years too. So these relative links are always going to be https:// on the internet. When serving from http://localhost, they turn into http://, which is never what we want. So rewrite them all to hard-code https://. Change-Id: I1c25108910a12f2974b8f6ba86d49d0b697516a4 Reviewed-on: https://go-review.googlesource.com/c/website/+/365099 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-11-22all: make golang.org and go.dev links relativeRuss Cox
Now that there is one site, update all golang.org links to go.dev. But for any links being served from go.dev, make host-relative, so that when serving golang.google.cn, we stay on that host as much as possible. Change-Id: Id6e1303059b5522846a64202bc1a8b81dc3854cd Reviewed-on: https://go-review.googlesource.com/c/website/+/365095 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-09-16_content/code.html: clarify that 'go test' runs in the source directoryRuss Cox
Fixes golang/go#44460. Change-Id: I8192bffa691015b1cb9a3cfa78958850891a67e5 Reviewed-on: https://go-review.googlesource.com/c/website/+/350250 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-09-08_content/doc: module naming best practicesSteve Traut
This adds new content with best practices for the module path. It also revises existing content to use the best practice. This change includes: * A new "Naming a module" section in "Managing dependencies" describing naming best practices and reserved terms for module paths. * Changing module path prefix from "example.com/*" to "example/*" where the content seems aimed specifically at new users. This is designed to reduce confusion for those who wonder if a domain name is required in the local, simple context. * Links to the "Naming a module" section so that new users can follow up from the simple case to learn about best practices. Change-Id: I07eac1f805ce506a486d3c0e7b54539554e3c30b Reviewed-on: https://go-review.googlesource.com/c/website/+/344469 Trust: Steve Traut <straut@google.com> Trust: Bryan C. Mills <bcmills@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org>
2021-08-17internal/web: merge with go.dev/cmd/internal/siteRuss Cox
internal/web was the framework left serving golang.org. go.dev/cmd/internal/site was the framework serving go.dev. This CL merges the two into a coherent, simple site serving framework that works for both sites, a step toward merging the sites themselves. The CL is difficult to break up, so it's a bit larger than would be ideal. The best place to start is the doc comment in internal/web/site.go and then the other changes in that directory. The rest of the CL is just minor adjustments to the repo to match. Change-Id: I927dea29396104a817bd81b6bf25fa43f996968f Reviewed-on: https://go-review.googlesource.com/c/website/+/339403 Trust: Russ Cox <rsc@golang.org> Website-Publish: Russ Cox <rsc@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-06-14internal/godoc: clean up use of templatesRuss Cox
- convert from text/template to html/template - use proper template set - always pass *godoc.Page to templates, with custom value in .Data - move stateful site template functions to methods on *godoc.Page - unexport Presentation.ServeFile: ServeHTTP is good enough - reorder api.DB.Func args to match source order (pkg first) - rename lib/godoc/godoc.html to lib/godoc/site.html (lib/godoc itself must stay lib/godoc because of links to other content it holds). Change-Id: I873f17db20107fdab11d276932e6d847a6081015 Reviewed-on: https://go-review.googlesource.com/c/website/+/317655 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-03-02_content/doc: fix module and tutorial bugs and clean up flowSteve Traut
For golang/go#44241 - Fix issues 2, 3, 8, 16, 17, 18 from golang/go#44241 Other changes in multiple topics: - In markdown, replace HTML anchor tags with {#anchor} tags. - In a few places, add content to clarify that module path must be a location from which the module can be downloaded. - Where it was missing, add example.com domain to example module paths. Hopefully, this will reinforce the idea that the module path should typically include a domain. Docs will use something that looks like a domain name for module path. - Add more cross-references from tutorial to references for packages and commands. - Rewrite a few links so that they include the topic title, rather than simply inline text. Left those links whose destinations are references -- the item's name seems to suggest that a reference is at the destination. - Remove domain name from golang.org doc links, leaving root directory. Such as /cmd/go/* or /doc/modules/* - Add path up to root for all links in the same domain. Some were linking by file name only. - Change standard library links from golang.org to pkg.go.dev. Changes in the module tutorial: - Add text to help clarify that there should be a hello and greetings directory as siblings in their directory hierarchy. Some users thought one should be subordinate to the other. - Where needed, reorder steps so that `go mod init` is run before code is added. This is intended to reinforce the importance of the module's presence. - In require/replace steps, have the user use `go mod edit` rather than editing the go.mod file in an editor. The tools are more likely to yield a functioning result. - Where possible/appropriate, change module directive link destinations from "Modules reference" to go.mod reference. - Change "run the code" steps so that they all use `go run .` rather than `go build` or `go run <filename>`. This removes the impedance of explanation and more commands, while moving the explanation of `go build` and `go install` to a separate topic where they share a clearer context. - Add a "Conclusion" topic with a few links. The tutorial ended rather abruptly before. - Minor edits to remove some redundant language. Change-Id: I93055035d73c362ba73edea458fc53bc45e66512 Reviewed-on: https://go-review.googlesource.com/c/website/+/297531 Trust: Steve Traut <straut@google.com> Run-TryBot: Steve Traut <straut@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
2021-02-16_content: move content/static/* to _content/*Russ Cox
The extra level of hierarchy here is unnecessary and confusing. The directory is now _content so that any Go source files in our docs are not considered by commands like "go mod tidy" and "go test all". Change-Id: Ib6d7cb12920193798ee825155a8f8b33f16e60d8 Reviewed-on: https://go-review.googlesource.com/c/website/+/291691 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>