We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
package main import ( "fmt" "github.com/cosmos72/gomacro/fast" ) func main() { // case1() // as expected // case2() // panic: expression returns 1 value, expecting 2: "1" case3() // Different compilation behaviour from native go. Why did the compilation not fail? } func case1() { interp := fast.New() script := `func Execute()(string,error){ return "1",nil }` interp.Eval(script) vs, _ := interp.Eval("Execute()") fmt.Println(vs[0].Interface()) // "1" fmt.Println(vs[1].Interface()) // nil } func case2() { interp := fast.New() script := `func Execute()(string,error){ return "1" }` interp.Eval(script) vs, _ := interp.Eval("Execute()") fmt.Println(vs[0].Interface()) fmt.Println(vs[1].Interface()) } func case3() { interp := fast.New() script := `func Execute()(string,error){ }` interp.Eval(script) vs, _ := interp.Eval("Execute()") fmt.Println(vs[0].Interface()) // "" fmt.Println(vs[1].Interface()) // nil }
Is this as expected?
The text was updated successfully, but these errors were encountered:
Gomacro does not currently report errors for missing return statements. So in a sense, yes, this is expected.
return
Although I am not sure whether it's worth having such a difference from Go toolchain.
Sorry, something went wrong.
Gomacro does not currently report errors for missing return statements. So in a sense, yes, this is expected. Although I am not sure whether it's worth having such a difference from Go toolchain.
Thanks, I see.
cosmos72
No branches or pull requests
Is this as expected?
The text was updated successfully, but these errors were encountered: