Skip to content

redundant-final-return

Remove a bare return at the end of a resultless function.

Updated View as Markdown

Default severity: warning

A resultless function returns automatically after its final statement. An explicit bare return at that position adds no control-flow information.

Bad

func notify() {
	sendNotification()
	return
}

Good

func notify() {
	sendNotification()
}
Navigation

Type to search…

↑↓ navigate↵ selectEsc close