-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FrozenDueToAgeLanguageChangeSuggested changes to the Go languageSuggested changes to the Go language
Milestone
Description
by bob.appleyard:
func example(x int) int { if x == 0 { return 5; } else { return x; } } Gives the error "function ends without a return statement" Changing it to: func example(x int) int { if x == 0 { return 5; } else { return x; } panic("unreachable"); } Solves the problem, however this is quite clearly a workaround. GOOS=linux GOARCH=amd64 Local revision: changeset: 3988:b773b8255a8f tag: tip user: Russ Cox <rsc@golang.org> date: Wed Nov 11 13:08:35 2009 -0800 summary: avoid clash with stdio's getc, ungetc.
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeLanguageChangeSuggested changes to the Go languageSuggested changes to the Go language