bogus "missing return at end of function"

52 views
Skip to first unread message

Marvin Renich

unread,
Jun 9, 2019, 8:40:38 PM6/9/19
to golang-nuts
Is it already a known issue that a «for [true] { ... }» loop whose only
exit path is through return statements inside the loop (i.e. no break
statement) will produce the compiler error "missing return at end of
function" if you don't put a meaningless "return ..." statement after
the loop?

If this issue is not already known, will someone who has a github
account please file this issue for me?

Thanks...Marvin

Michal Strba

unread,
Jun 9, 2019, 8:43:55 PM6/9/19
to golang-nuts
Can you post a code (preferably a link to play.golang.org) that does this?

I can't reproduce it myself.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/20190610004002.ltcv36765lkn75xp%40basil.wdw.
For more options, visit https://groups.google.com/d/optout.

Marvin Renich

unread,
Jun 9, 2019, 8:46:24 PM6/9/19
to golang-nuts, 4...@renich.org
* Marvin Renich <mr...@renich.org> [190609 20:40]:
Sorry for the noise; this was my mistake. The error was being reported
in a different file than the one I had just edited, so I attributed the
error to the wrong code.

...Marvin

Reply all
Reply to author
Forward
0 new messages