Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
proposal: cmd/vet: magic comment to check that variable is stack allocated #34798
Go doesn't directly allow for heap vs. stack allocation, but this is critical to ensuring high performance. You can check that variables are properly stack allocated by asking Go to report what escapes to the heap with
The comment should have no actual effect on escape analysis. It will merely create a visible error if something is not allocated as intended.