Advanced Go (Golang)
Q97 / 100

What is the Go compiler's escape analysis output and how do you inspect it?

Correct! Well done.

Incorrect.

The correct answer is B) go build -gcflags=-m prints why variables escape to the heap, helping identify unintentional allocations in performance-critical code

B

Correct Answer

go build -gcflags=-m prints why variables escape to the heap, helping identify unintentional allocations in performance-critical code

Explanation

go build -gcflags="-m -m" shows detailed escape analysis. "moved to heap" means an allocation occurs. Closures over pointers, interface conversions often cause escape.

Progress
97/100