Advanced Go Reading Notes

Source: Internet
Author: User

First, the Language foundation

  1. Main.main function Execution procedure


    Image.png
  2. Slice the underlying array part is passed by an implicit pointer (the pointer itself is a value, only pointing to the same data), and the callee modifies the data in the underlying array by using the pointer to slice the calling parameter. But the slice itself is to maintain its corresponding data structure, for example, length and capacity. In addition, the underlying array that it points to will change when slice the underlying array. Therefore, such operations like append must return a slice reason.

There is no limit to the recursive invocation depth of functions in 3.golang, and there is no overflow error in the function call stack, because Golang dynamically adjusts the size of the function stack as needed at run time. Each goroutine just start with a small stack (4KB or 8KB), dynamically adjust the size of the stack as needed, the maximum stack can reach the GB level.


Image.png

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.