Jump statements (return, break, continue, goto) and throw expressions move control flow out of the current code block. So any unlabelled statements that come after a jump are dead code.

Noncompliant Code Example

func add(x, y int) int {
	return x + y // Noncompliant
	z := x + y // dead code
}

Compliant Solution

func add(x, y int) int {
	return x + y // Compliant
}

See