New issue
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
Golang example #54
Comments
The go engine was added from yihui/knitr#1330 by @hodgesds. Perhaps we should add a minimal example to this repo. |
Just a side note here; I tried configuring the block like this:
but I get the following:
It's the same output when I run |
Here is an example of using a go package (non executable).
And for a main (executable) package:
Note that it will automatically call |
One last thought... is |
Sorry but that still doesn't work. Next I added the following to my file:
The blocks still are not recognized, but now when I execute the file, the block that contains the main function returns the following:
I double checked and my Go installation is on path, I also can confirm that because its my default language for development and I use other tools like Atom. |
Also, I had to change the snippet from
To
to get the error message |
What happens when you run |
When I run the command from Rstudio I see this: But when I check the $PATH from my terminal I get this: Note how they are different. |
This might be of help, perhaps try starting Rstudio from the terminal if you want to inherit the same path.
|
I added my system PATH to the file as described on that link you sent me, and now I started rstudio from terminal. When I run
Now it seems to be present on the path inside Rstudio as well. I typed the same block again
And now I'm getting the following :
The block is still unrecognized as 'runnable' |
Can you try running the minimal example in this repo: |
I opened Rstudio via command line and checked the path, the Go installation is present. I downloaded the file and created a new notebook. None of the blocks are recognized as executable and only the last one has the code colored. I clicked the 'Run All ' command and only the last block produced the following output:
|
It looks like that the go compiler is being found and is responding, but the block or the execution unit is not being passed to it. I changed the last block to this
|
I can't really help you debug your RStudio setup, please run the minimal example that is in this repo.
The contents of Hello package! package hello
func HelloWorld(){
println("hello world!")
} Hello main! package main
func main(){
println("hello world!")
}
Or specify an engine: package main
func main(){
println("hello world!")
}
|
yes I got the same thing. |
When running on the terminal I see the hidden go file being created, but I think the same is not true when running on Rstudio. It looks to me that the code should be on the /tmp folder but the same has nothing there. Could this snippet be the problem ? |
The code you have, when running on Rstudio output this:
See how the path ends with a |
interesting.... I'm guessing something here needs updated. If you trying using the |
Hey @hodgesds ; Is there any perspective to have this fixed in the near future ? |
Is there an example on how to use the GO language engine? If not, would it be possible to add one?
The language engine itself is already available, I'm just not too sure how to load and run.
Thanks
The text was updated successfully, but these errors were encountered: