First GO Program

Source: Internet
Author: User
  1. Package
    1. Go language has been wrapped as a management unit
    2. Each file must be declared first: package
    3. Each file must consist of a main package
  2. Import for importing libraries
    1. The referenced library must be used
  3. Entry function: There is only one entry function: Main
    1. Liteide: Direct GUI compilation, only one main function in a folder
    2. The opening brace of the function must be accompanied by the function name
  4. You cannot use a semicolon at the end of a statement
  5. Most of the compiled code in the Go language is on the command line
    1. Using the build command to generate an executable program
      1. Go build xxx.go Compile go code to generate an executable program
      2. Run an executable program to view the results
    2. Run directly with the run name
      1. Go run xxx.go does not produce execution programs, direct operations (content generation executable, but not visible)
  6. Cls:windows Clear Screen
220 Reads
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.