Golang at least.

Source: Internet
Author: User
This is a created article in which the information may have evolved or changed.

Variables that begin with 1:go capital letters can be exported, that is, public variables that other packages can read, lowercase letters that are not exportable, private variables, and the beginning of a function's capital letters.

2:

The two expressions of]int and [5]int] are fundamentally different in the go language. []int is not an array, but an array slice (slice), and [5]int is an array.] In the go language, an array is a value type, and an array slice is a reference type.

A value type variable is fully copied at the time of the function call's parameter pass, and then only the copy of the copy is manipulated within the function. This is shown in the 32nd page example, where the modification of an array within a function does not affect the reason for the contents of the original array outside the function. In general, the parameter type selects an array slice rather than an array to avoid the performance loss caused by the copy.

3:

Go ENV view GO environment variables

godoc-http=:8080 established local official website

4:golang change requires pointers, otherwise value is passed

U:=new (user) U is a pointer, var u User u is a value &u is a reference


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.