Build an offline go programming guide-gotour

Source: Internet
Author: User
Tags install go mercurial

To better promote the go language, Google builds a browser-based interactive go programming guide-gotour on its official website and appspot. Related Websites:

    1. Gotour -- English version
    2. Gotour-Chinese Version

This tutorial is easy to learn and consists of three parts:
The first part describes the basic concepts of the Go language, including packages, imports, functions, variables, conditions, loops, pointers, struct, slice, map, and range.
The second part describes methods, interfaces, errors, Web servers, and image processing.
The third part describes concurrency, goroutine, channel, buffer channel, range, close, select, and so on.

Each part provides a large number of examples.CodeCan be directly run on the web. Exercises are also provided at the end of each part. You can write code directly in the browser editing box provided by the tutorial, click the button in the upper left corner to "run" to view your own encoding results. For beginners, this online tutorial is indeed the best practise for learning go programming:

However, I would not letProgramThe domain names of the above two websites are seriously polluted by the pleasant use of Google services, and are often inaccessible or unstable. Fortunately, this tutorial provides the construction of a local offline version. Without access to the Internet, this tutorial can run as an independent web program. When running locally, the tutorial uses the local environment to build and compile the code, which runs faster and includes some enhancements that are not available in the sandbox version.

So I suggest all programmers who want to learn go build this go language tutorial based on the local environment. The building process is very simple:

    1. Install the go language environment. For details, refer to the Go official website guide. A brief introduction is as follows:

      • For OS X, you can directly useBrew install goTo install/Usr/local/cellar/goDirectory.
      • For Linux (UBUNTU ),Wget http://go.googlecode.com/files/go1.0.3.linux-amd64.tar.gzDownload the compiled installation package, and thenTar-C/usr/local-xzf go1.0.3.linux-amd64.tar.gz.
      • Set environment variables to ensure that the go command can be executed on the command line.
    2. Install another distributed management tool, Hg (mercurial). For more information about HG, see http://mercurial.selenic.com.
    • For OS X, you can useBrew install HgInstall.
    • For Linux (UBUNTU), you can useSudo apt-Get install mercurialInstall.
    • After the installation is complete, confirm that you can find the Hg command on the command line.
  • Go language installation Tutorial:Sudo go get code.google.com/p/go-tour/gotour
  • Go language installation Tutorial:Sudo go get bitbucket.org/mikespook/go-tour-zh/gotour
  • Run gotour on the command line and enter the following in the browser address:Http: // 127.0.0.1: 3999To go to the learning interface of the tutorial.
  • Happy learning!

    Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.