Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardGoEscape analysisSingle-choice MCQ

Escape analysis interacts with inlining. Which statement about a small function that returns a pointer to a local is correct once the compiler inlines it into a caller that immediately dereferences and discards the result?

func mk() *int { x := 7; return &x } func use() int { return *mk() }