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
It works okay when given a single statement and -quiet is not used:
-quiet
$ goexec -n 'fmt.Println("hi")' package main import ( "fmt" "github.com/shurcooL/go-goon" ) func main() { goon.Dump(fmt.Println("hi")) }
But it generates invalid code when given multiple statements and -quiet is not used:
$ goexec -n 's := "hi"; fmt.Println(s)' package main import ( "github.com/shurcooL/go-goon" ) func main() { goon.Dump(s := "hi"; fmt.Println(s)) } imports.Process: gen.go:8:14: missing ',' in argument list
It should've been turned into:
s := "hi"; goon.Dump(fmt.Println(s))
A fix might be to parse the input, count number of statements, and add goon.Dump around the last one only.
goon.Dump
Need to parse as Go code. Otherwise it could fail on input that contains a string with a semicolon, e.g., goexec 'fmt.Println("foo;bar")'.
goexec 'fmt.Println("foo;bar")'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It works okay when given a single statement and
-quiet
is not used:But it generates invalid code when given multiple statements and
-quiet
is not used:It should've been turned into:
A fix might be to parse the input, count number of statements, and add
goon.Dump
around the last one only.Need to parse as Go code. Otherwise it could fail on input that contains a string with a semicolon, e.g.,
goexec 'fmt.Println("foo;bar")'
.The text was updated successfully, but these errors were encountered: