I've been writing Go for the last 18 months, and seeing it dissected side-by-side with C [0] is causing some epiphanies that I wouldn't normally get to see in day-to-day programming.
Excellent resource.
Excellent resource.
// memory allocated on heap:
ptr := new(int)
*ptr = 7
Depending on how ptr is used, escape analysis may place *ptr on the stack. Also note that the terms stack and heap are not directly comparable between languages anyway.I saw this and thought that it's just weird and confusing. Why would someone make case-sensitivity a syntax for exports?
Whether the process is sent a SIGFPE or not, from the programmer's experience a x/0 will cause the offending goroutine to panic with a divide by zero runtime error (integer divide by zero) which, unlike a signal, can be recovered.