常常在社群里面看到从其他程式语言转来用Go会有的问题
这些是找到的资料跟总结
同步更新在github上
https://github.com/whitefloor/coding-interview-university-reading-notes-use-golang
Stack and Heap
一般的Stack & Heap
https://nwpie.blogspot.com/2017/05/5-stack-heap.htmlhttps://medium.com/@yauhsienhuang/stack-%E8%88%87-heap-%E6%9C%89%E4%BD%95%E5%B7%AE%E5%88%A5-acdcc11263a0Golang的Stack & Heap
https://golang.org/doc/faq#stack_or_heaphttp://devs.cloudimmunity.com/gotchas-and-common-mistakes-in-go-golang/index.html#stack_heap_varshttps://medium.com/eureka-engineering/understanding-allocations-in-go-stack-heap-memory-9a2631b5035dhttps://stackoverflow.com/questions/10866195/stack-vs-heap-allocation-of-structs-in-go-and-how-they-relate-to-garbage-collec总结
别用中文翻译去记,很难翻译而且很难记Stack
静态记忆体配置
A call stack is a LIFO stack data structure that stores arguments, local variables, and other data tracked as a thread executes functions
将可预期的变数或是function等...的处理方法
Heap
动态记忆体配置将不可预期的变数或资料分配管理,且会被GC回收的处理方法
Golang的Stack & Heap
Go在使用上并没有提到Stack or Heap 只会在GC(garbage-collected)内遵循一套严格的规则进行处理If you need to know where your variables are allocated pass the "-m" gc flag to "go build" or "go run" (e.g., go run -gcflags -m app.go).