-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
_content: serve wiki pages on go.dev
The wiki pages have been copied to go.googlesource.com/wiki and will be code reviewed using Gerrit, like other Go repos. Unlike other Go repos, self-review will be permitted, and there is no requirement for Googlers to be involved to make a change. These relaxations are possible because the wiki has no production code. The set of wiki +2'ers is a superset of the usual code +2'ers. Fixes golang/go#61940. Change-Id: I01823720091fbaa24e95e9c82abeaadba867a17c Reviewed-on: https://go-review.googlesource.com/c/website/+/518297 Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
- Loading branch information
Showing
13 changed files
with
169 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
title: Comments | ||
--- | ||
|
||
<!-- | ||
This is just a placeholder page for enabling a test. | ||
In the deployed site it is overwritten with the content of go.googlesource.com/wiki. | ||
--> | ||
|
||
Every package should have a package comment. It should immediately precede the ` package ` statement in one of the files in the package. (It only needs to appear in one file.) It should begin with a single sentence that begins "Package _packagename_" and give a concise summary of the package functionality. This introductory sentence will be used in godoc's list of all packages. | ||
|
||
Subsequent sentences and/or paragraphs can give more details. Sentences should be properly punctuated. | ||
|
||
```go | ||
// Package superman implements methods for saving the world. | ||
// | ||
// Experience has shown that a small number of procedures can prove | ||
// helpful when attempting to save the world. | ||
package superman | ||
``` | ||
|
||
Nearly every top-level type, const, var and func should have a comment. A comment for bar should be in the form "_bar_ floats on high o'er vales and hills.". The first letter of _bar_ should not be capitalized unless it's capitalized in the code. | ||
|
||
```go | ||
// enterOrbit causes Superman to fly into low Earth orbit, a position | ||
// that presents several possibilities for planet salvation. | ||
func enterOrbit() os.Error { | ||
... | ||
} | ||
``` | ||
|
||
All text that you indent inside a comment, godoc will render as a pre-formatted block. This facilitates code samples. | ||
|
||
```go | ||
// fight can be used on any enemy and returns whether Superman won. | ||
// | ||
// Examples: | ||
// | ||
// fight("a random potato") | ||
// fight(LexLuthor{}) | ||
// | ||
func fight(enemy interface{}) bool { | ||
// This is testing proper escaping in the wiki. | ||
for i := 0; i < 10; i++ { | ||
println("fight!") | ||
} | ||
} | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{{define "layout"}} | ||
{{doclayout .}} | ||
{{end}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: Index | ||
--- | ||
|
||
The Wiki is still loading... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters