cxgo icon indicating copy to clipboard operation
cxgo copied to clipboard

Goto forbidden by Go

Open dennwc opened this issue 4 years ago • 1 comments

Go has more strict rules regarding what goto jumps are valid.

cxgo currently doesn't reflow goto automatically. So "bad" goto will fail to compile in Go.

There is a workaround implemented in cxgo as one of the "ugly" ways to make the code compile. This workaround will completely flatten the code in a specified function.

We can try to implement a proper reflow algorithm, since those kind of goto statements are quite common.

dennwc avatar Jan 10 '21 20:01 dennwc

Solving the structured control flow problem once and for all is a good article for anyone wanting to solve this issue

TotallyGamerJet avatar Jul 20 '21 17:07 TotallyGamerJet