core icon indicating copy to clipboard operation
core copied to clipboard

yaegicore default main function issue, in content

Open rcoreilly opened this issue 5 months ago • 0 comments

Describe the bug

@kkoreilly please edit to clarify this as needed -- just a prompt to remember to fix this:

  • If you define types and code without a main() function, the code will not run.
  • Therefore, main is automatically inserted by yaegicore for Go
  • But not for Goal, but we should enable it for Goal as well
  • When you want to define a custom type with methods (such as for custom widgets), you can make your own main function for the main code so that things work properly (yaegicore only adds a main function if there isn't already one).

How to reproduce

Example code


Relevant output


Platform

macOS

rcoreilly avatar Jul 15 '25 20:07 rcoreilly