blob: 0b5a282fa7edb633f643b1193b542a018efb9c48 [file] [log] [blame]
Welcome!
Learn how to use this tour: including how to navigate the different lessons and how to run code.
The Go Authors
https://golang.org
* Hello, 世界
Welcome to a tour of the [[/][Go programming language]].
The tour is divided into a list of modules that you can
access by clicking on
[[javascript:highlight(".logo")][A Tour of Go]] on the top left of the page.
You can also view the table of contents at any time by clicking on the [[javascript:highlightAndClick(".nav")][menu]] on the top right of the page.
Throughout the tour you will find a series of slides and exercises for you
to complete.
You can navigate through them using
- [[javascript:highlight(".prev-page")]["previous"]] or `PageUp` to go to the previous page,
- [[javascript:highlight(".next-page")]["next"]] or `PageDown` to go to the next page.
The tour is interactive. Click the
[[javascript:highlightAndClick("#run")][Run]] button now
(or press `Shift` + `Enter`) to compile and run the program on
#appengine: a remote server.
your computer.
The result is displayed below the code.
These example programs demonstrate different aspects of Go. The programs in the tour are meant to be starting points for your own experimentation.
Edit the program and run it again.
When you click on [[javascript:highlightAndClick("#format")][Format]]
(shortcut: `Ctrl` + `Enter`), the text in the editor is formatted using the
[[/cmd/gofmt/][gofmt]] tool. You can switch syntax highlighting on and off
by clicking on the [[javascript:highlightAndClick(".syntax-checkbox")][syntax]] button.
When you're ready to move on, click the [[javascript:highlightAndClick(".next-page")][right arrow]] below or type the `PageDown` key.
.play welcome/hello.go
* Go local
The tour is available in other languages:
- [[https://go-tour-br.appspot.com/][Brazilian Portuguese — Português do Brasil]]
- [[https://go-tour-ca.appspot.com/][Catalan — Català]]
- [[https://tour.go-zh.org/][Simplified Chinese — 中文(简体)]]
- [[https://go-tour-cz.appspot.com/][Czech — Česky]]
- [[https://go-tour-id2.appspot.com/][Indonesian — Bahasa Indonesia]]
- [[https://go-tour-jp.appspot.com/][Japanese — 日本語]]
- [[https://go-tour-ko.appspot.com/][Korean — 한국어]]
- [[https://go-tour-pl1.appspot.com/][Polish — Polski]]
- [[https://go-tour-th.appspot.com/][Thai — ภาษาไทย]]
- [[https://go-tour-ua-translation.lm.r.appspot.com/][Ukrainian — Українською]]
Click the [[javascript:highlightAndClick(".next-page")]["next"]] button or type `PageDown` to continue.
#appengine: * Go offline (optional)
#appengine:
#appengine: This tour is also available as a stand-alone program that you can use
#appengine: without access to the internet. It builds and runs the code samples on
#appengine: your own machine.
#appengine:
#appengine: To run the tour locally, you'll need to first
#appengine: [[/doc/install][install Go]] and then run:
#appengine:
#appengine: go install golang.org/x/website/tour@latest
#appengine:
#appengine: This will place a `tour` binary in your
#appengine: [[/cmd/go/#hdr-GOPATH_and_Modules][GOPATH]]'s `bin` directory.
#appengine: When you run the tour program, it will open a web browser displaying
#appengine: your local version of the tour.
#appengine:
#appengine: Of course, you can continue to take the tour through this web site.
#appengine: * The Go Playground
#appengine:
#appengine: This tour is built atop the [[https://play.golang.org/][Go Playground]], a
#appengine: web service that runs on [[/][golang.org]]'s servers.
#appengine:
#appengine: The service receives a Go program, compiles, links, and runs the program inside
#appengine: a sandbox, then returns the output.
#appengine:
#appengine: There are limitations to the programs that can be run in the playground:
#appengine:
#appengine: - In the playground the time begins at 2009-11-10 23:00:00 UTC (determining the significance of this date is an exercise for the reader). This makes it easier to cache programs by giving them deterministic output.
#appengine:
#appengine: - There are also limits on execution time and on CPU and memory usage, and the program cannot access external network hosts.
#appengine:
#appengine: The playground uses the latest stable release of Go.
#appengine:
#appengine: Read "[[/blog/playground][Inside the Go Playground]]" to learn more.
#appengine:
#appengine: .play welcome/sandbox.go
* Congratulations
You've finished the first module of the tour!
Now click on [[javascript:highlightAndClick(".logo")][A Tour of Go]] to find out what else
you can learn about Go, or go directly to the [[javascript:click('.next-page')][next lesson]].