Build version {Version|html-esc}. Except as noted, this content is licensed under a Creative Commons Attribution 3.0 License.
+diff --git a/doc/all.css b/doc/all.css new file mode 100644 index 0000000000..dc632ef973 --- /dev/null +++ b/doc/all.css @@ -0,0 +1,151 @@ +body { + font-family: "Bitstream Vera Sans", Verdana, sans-serif; + font-size: 81.25%; + line-height: 1.23em; + padding: 0; + margin: 1.23em; +} +a { + color: #04a; + text-decoration: none; +} +a:visited { + color: #04a; +} +a:hover { + color: #a40; + text-decoration: underline; +} +a:active { + color: #c00; +} +#container { + width: 76em; + margin: auto; +} +#topnav { + height: 55px; +} +#branding-logo { + width: 50%; + margin: 0; + padding: 0; + height: 55px; + background: url(/doc/logo.png) no-repeat; +} +#branding-logo a { + display: block; + width: 100%; + height: 55px; +} +#branding-logo span { + display: none; +} +#nav-main { + position: relative; + top: -60px; + width: 50%; + margin-left: 50%; + text-align: center; +} +#nav-main ul { + padding-left: 0; + margin-left: 0; + margin-bottom: 0.5em; +} +#nav-main li a { + display: inline; + display: inline-block; + padding: .46em .62em .38em .62em; +} +#nav-main li a:link, +#nav-main li a:visited { + color: #000; +} +#nav-main li { + display: inline; + display: inline-block; + background: #e6e6e6 url(/doc/button_background.png) repeat-x; + border: solid 1px #999; + margin-left: -1px; + text-shadow: #fff 0 1px 0; + box-shadow: 0 1px 1px #ccc; + -moz-box-shadow: 0 1px 1px #ccc; + -webkit-box-shadow: 0 1px 1px #ccc; +} +#nav-main li:first-child { + -moz-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; +} +#nav-main li:last-child { + -moz-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -moz-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; +} +#nav-main .quickref { color: #444; } +#search { + width: 100px; + margin-left: 0.5em; +} +#search.inactive { + text-align: center; + color: #444; +} + +#content { + padding: 0; + position: relative; + margin-top: 1.5em; + margin-bottom: 1.5em; + border-top: solid 1px #aaa; + border-bottom: solid 1px #aaa; +} +#site-info { + position: relative; + text-align: center; +} +#site-info, #site-info a:link, #site-info a:visited { + color: #aaa; +} +#nav table { + width: 100%; +} + +#content h1 { + margin-bottom: -0em; + padding: 0; +} +#content h2 { + border-top: 1px solid #ddd; + background: #E2E7F0; + padding: 2px 5px 5px; + margin: 1.5em 0 0; +} +#content .subtitle { margin-top: 1em; display: block; } + +.navtop a { + font-weight: normal; font-size: 7pt; + float: right; color: #999; +} + +code, pre { font-size: 1.2em; } +pre { background: #F0F0F0; padding: 0.5em 1em; } +pre.ebnf, pre.grammar { background: #FFFFE0; } + +.detail { + padding: 0.25em 1em; + background: #F4F4F4; +} + +.left-column { + width: 48%; + float: left; +} +.right-column { + width: 48%; + float: right; +} +.end-columns { clear: both; } diff --git a/doc/button_background.png b/doc/button_background.png new file mode 100644 index 0000000000..86a3b3086a Binary files /dev/null and b/doc/button_background.png differ diff --git a/doc/community.html b/doc/community.html new file mode 100644 index 0000000000..c3b16cacbc --- /dev/null +++ b/doc/community.html @@ -0,0 +1,53 @@ + + +
The golang-nuts +mailing list is for general Go discussion.
+ +A list of the most popular goinstall'd +Go libraries.
+ +A list of external Go projects including programs and libraries.
+ +#go-nuts on irc.freenode.net is the official Go IRC channel.
+ +The Go project's official Twitter account.
+ ++The Go project's official blog, maintained by the core Go developers. +
+ ++Posts labelled 'Go' by Russ Cox, one of the core Go developers. +
+ ++Posts labelled 'Programming' by Ian Lance Taylor, one of the core Go developers. +
+ ++Posts labelled 'Go' by Andrew Gerrand, one of the core Go developers. +
+ +Having an issue with Go? Check the tracker to see if it's a known issue.
+If your issue is not listed, please file a bug report.
+ +View the status of Go builds across the supported operating +systems and architectures.
+ +So, you want to contribute code to the Go project? That's great!
+The first step is to read these contributions guidelines for information on +design, testing, and our code review process.
+ +Features and ideas being developed or discussed by the Go team.
+ +A summarization of the changes between tagged releases of Go.
+ +The golang-dev +mailing list is for discussing and reviewing code for the Go project.
+For general discussion of Go programming, see golang-nuts.
+ +A mailing list that receives a message summarizing each checkin to the Go repository.
+ +-If you're new to Go, we recommend following the -tutorial while consulting the -language spec. -Then read Effective Go, as it addresses many -common beginner questions. +If you're new to Go, we recommend you work through the +tutorial. The +language specfication has all the details should +you want to explore.
- -Keep these under your pillow.
- --The built-in documentation for the Go standard library. +Once you've learned a little about the language, +Effective Go will help you learn the style and +idioms of programming in Go.
--The built-in 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. -
- -The first tutorial. An introductory text that touches upon several core @@ -51,6 +30,11 @@ A must read for any new Go programmer. It augments the tutorial and the language spec, both of which should be read first.
++How to write a new package and how to test code. +
+This codelab takes the reader through the creation of a simple wiki web @@ -63,13 +47,24 @@ and closures. An introduction to Go for C++ programmers.
--How to write a new package and how to test code. +Answers to common questions about Go.
++Answers to common questions about programming with Go. +
-+Answers to common questions about the design decisions behind Go. +
+ +@@ -86,39 +81,40 @@ A German translation of the Effective Go document. A German translation of the How to Write Go Code document.
- --Answers to common questions about Go. +A Chinese translation of both the Effective Go and Go Tutorial documents.
-Keep these under your pillow.
+ +-Answers to common questions about the design decisions behind Go. +The built-in documentation for the Go standard library.
--Answers to common questions about programming with Go. +The built-in documentation for the Go tools.
--How to contribute changes to the Go project. +The official Go Language specification.
--Features and ideas being developed or discussed by the Go team. -
- --A summarization of the changes between tagged releases of Go. +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 demonstration of the practical use of goroutines and channels. -
- --A self-describing Codewalk. -
- - --Articles about Go from external blogs. -
- --Posts labelled 'Go' by Russ Cox, one of the core Go developers. -
- --Posts labelled 'Programming' by Ian Lance Taylor, one of the core Go developers. -
+ diff --git a/doc/frontpage.css b/doc/frontpage.css new file mode 100644 index 0000000000..bc29f48881 --- /dev/null +++ b/doc/frontpage.css @@ -0,0 +1,125 @@ +#content-introductory code { + font-family: "Bitstream Vera Sans Mono", "Andale Mono", monospace; +} +#content-introductory input, select, textarea { + font-family: "Bitstream Vera Sans", Verdana, sans-serif; + font-size: 1em; +} +span.keyword { + font-family: Cambria, Georgia, Times, "Times New Roman", serif; + font-size: 1.15em; + font-style: italic; +} +#content h3, #content h2 { + margin: 0; + font-size: 1em; + background: none; + border: none; + padding: 0; +} +#content .more { + color: #999; + font-weight: normal; +} +#frontpage h2#branding-tagline { + font-weight: normal; + font-style: italic; +} +#resources { + position: relative; + margin-top: 1em; +} +#resources h3 { + margin-top: 0; + margin-bottom: -.5em; + font-size: 1em; + font-weight: normal; +} +#resources-users { + float: left; + width: 48%; +} +#resources-contributors { + float: right; + width: 50%; +} +#resources ul { + padding-left: 2em; +} +#resources li { + margin-bottom: 0.5em; +} +#content-rotating { + height: 200px; +} +#content-videos { + float: left; + width: 170px; +} +#content-videos .thumbnail { + width: 150px; + height: 103px; + background-repeat: no-repeat; + border: none; +} +#content-videos .thumbnail._001 { + background: url(/doc/video-001.png); +} +#content-videos .thumbnail._002 { + background: url(/doc/video-002.png); +} +#content-videos .thumbnail._003 { + background: url(/doc/video-003.png); +} +#content-videos a.video { + display: inline-block; + width: 150px; + margin-right: .30em; + margin-top: 1.2em; +} +#content-videos a.video .caption { + display: block; + text-align: center; +} +#content-videos a.video .caption.title { + margin-top: .31em; + font-weight: bold; +} +#content-blog ul { + margin-top: 1em; + margin-left: 0; + padding-left: 0; +} +#content-blog li { + list-style: none; + margin-bottom: 1em; +} +#content-blog li a { + color: #999; + text-decoration: none; +} +#content-blog .date { + color: #999; + font-size: 0.8em; + display: inline-block; + margin-left: 0.5em; +} +#content-blog li a:link .title { + color: #04a; +} +#content-blog li a:visited .title { + color: #04a; +} +#content-blog li a:hover .title { + color: #a40; + text-decoration: underline; +} +#content-blog li a:active .title { + color: #c00; +} + +.navtop { + display: none !important; +} + +.unsupported { font-weight: bold; color: red; } diff --git a/doc/go_faq.html b/doc/go_faq.html index 4f11baa80e..5ca791c50e 100644 --- a/doc/go_faq.html +++ b/doc/go_faq.html @@ -1,5 +1,9 @@ +Is your question not answered here? Try the Programming FAQ or the Language Design FAQ.
+Is your question not answered here? Try the Programming FAQ or the Go FAQ.
+Is your question not answered here? Try the Go FAQ or the Language Design FAQ.
+
There are two distinct ways to experiment with Go.
This document focuses on the gc
Go
@@ -64,11 +66,20 @@ The full set of supported combinations is listed in the discussion of
environment variables below.
The Go tool chain is written in C. To build it, you need -to have GCC, the standard C libraries, the parser generator Bison, -make, awk, and the text editor ed installed. +
The Go tool chain is written in C. +To build it, you need these programs installed: +
On OS X, they can be @@ -76,18 +87,28 @@ installed as part of Xcode.
-On Linux, use sudo apt-get install bison ed gawk gcc libc6-dev make
-(or the equivalent on your Linux distribution).
+
On Ubuntu/Debian, use sudo apt-get install bison ed gawk gcc libc6-dev make
.
+
+To perform the next step you must have Mercurial installed. (Check that you have an hg
command.) This suffices to install Mercurial most systems:
+
+sudo easy_install mercurial ++(On Ubuntu/Debian, you might try
apt-get install python-setuptools
+python-dev build-essential
first. The Mercurial in your distribution's
+package repository will most likely be old and broken.)
+
++If that fails, try installing manually from the Mercurial Download page.
-If you do not have Mercurial installed (you do not have an hg
command),
-sudo easy_install mercurial
works on most systems.
-(On Ubuntu/Debian, you might try apt-get install python-setuptools python-dev build-essential gcc
first.)
-If that fails, visit the Mercurial Download page.
Go will install to a directory named go
.
Change to the directory that will be its parent
and make sure the go
directory does not exist.
@@ -129,8 +150,11 @@ and the details on the last few lines will reflect the operating system,
architecture, and root directory used during the install.
For more information about ways to control the build, see the discussion of environment variables below.
+hello.6
.
+To build more complicated programs, you will probably want to use a @@ -208,6 +233,28 @@ about contributing to the Go project gives more detail about the process of building and testing Go programs.
++Start by reading the Go Tutorial. +
+ ++Build a web application by following the Wiki +Codelab. +
+ ++Read Effective Go to learn about writing +idiomatic Go code. +
+ ++For the full story, consult Go's extensive +documentation. +
+The Go Playground is a web service that runs on +golang.org's servers. +The service receives a Go program, compiles, links, and runs the program inside +a sandbox, then returns the output. +
+ ++There are limitations to the programs that can be run in the Playground. +They must be single-threaded (but they may use many goroutines). +There are also limits on execution time, and CPU and memory usage. +The Playground can access only a subset of the standard library +(notably absent are network and filesystem access). +Therefore, the only communication a Playground program has to the outside world +is via standard output. +
- ![]() |
-
- a systems programming language
- expressive, concurrent, garbage-collected |
-
+ 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. +
++ Install Go now, or try it right here in your browser: [How does it work?]
+ + +Go is …
- --package main - -import "fmt" - -func main() { - fmt.Printf("Hello, 世界\n") -}- -
Go has a small, simple feature set, making it easy to learn.
- --Go compilers produce fast code fast. Typical builds take a fraction of a second yet the resulting programs run nearly as quickly as comparable C or C++ code. -
- --Go promotes writing systems and servers as sets of lightweight communicating -processes, called goroutines, with strong support from the language. Run -thousands of goroutines if you want—and say good-bye to stack overflows. -
- -Go is type safe and memory safe. Go has pointers but no pointer arithmetic. -For random access, use slices, which know their limits.
- --Go has fast builds, clean syntax, garbage collection, -methods for any type, and run-time reflection. -It feels like a dynamic language but has the speed and safety of a static language. -It's a joy to use. -
- --Go for it. -
- -Build version {Version|html-esc}. Except as noted, this content is licensed under a Creative Commons Attribution 3.0 License.
+