forked from golang/go
-
Notifications
You must be signed in to change notification settings - Fork 0
Comments
nathany edited this page Dec 11, 2014
·
2 revisions
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.
// 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.
// enterOrbit causes Superman to fly into low Earth orbit, a position
// that presents several possibilities for planet salvation.
func enterOrbit() os.Error {
...
}
- Home
- Getting started with Go
- Working with Go
- Learning more about Go
- The Go Community
- Using the Go toolchain
- Additional Go Programming Wikis
- Online Services that work with Go
- Troubleshooting Go Programs in Production
- Contributing to the Go Project
- Platform Specific Information
- Release Specific Information