- Created Monday, July 27th 2015 @ 15:11:44
Hi. my go bot is not compiling after I upload it:
named files must all be in one directory
Which steps are done in order to compile the go source code? It seems you are just passing all contained go files as parameters to "go build", which can not work if using multiple packages. For the same reason (multiple packages), we can also not just put all go files to the root of the archive (packages are sub-folders).
Also, the import names must match the folder structure. Is the folder in which you build the source contained in the GOPATH environment variable?
See http://golang.org/doc/code.html#Organization if you need more information about how Go workspaces are organized.
Your compile process should work like this:
- extract the archive to $GOPATH/src
- cd <PATH-WHERE-main.go-IS> (something like $GOPATH/src/my/bot, all the sub packages are there too)
- go build (without go files as parameters)
Is there any chance you can support this? I cannot see how to build a properly structured go program on your platform. Correct me if I'm missing something.
p.s. I see you are still using go 1.1.1. Could you upgrade it to at least the current stable release go 1.4.2?
- Created Tuesday, July 28th 2015 @ 09:08:20
Alright send me your bot please then, so I can test it.
- Created Thursday, July 30th 2015 @ 10:47:23
Ok I have upgraded the Go version to 1.4.2, but it is not possible to build in your way. On the server we have some restrictions that prohibit the compiler from accessing certain things (as it should be). Your process works great locally, but sadly not for a scripted compiler on the server.
- Created Thursday, July 30th 2015 @ 14:00:48
Sad to hear this. But I'm curious, what exactly prevents the compiling? The only thing that must be done is to create a "src" folder where the zip is unpacked. Then calling the go compiler as usual (with the GOPATH env set to the parent of this src folder) should not lead to more accessed resources than before? You don't need a globally shared GOPATH.
If it really is not possible I would suggest you remove go from the supported languages, as you can't build non-trivial go programs. It would be the same as supporting java but only without packages.
- Created Monday, April 25th 2016 @ 19:05:26
Could you upgrade to at least Go 1.5+? That we can use vendored packages. 1.6 would be ideal
- Created Thursday, April 28th 2016 @ 02:07:41
Oh great! Thanks so much. What does it mean when it says all files have to be in one directory? Does it just run
go run *.goin the directory?
- Created Thursday, April 28th 2016 @ 08:54:47
I made the Go compiler a long time ago, but from what I can remember I couldn't get the bots to run if the files were in separate folders. The files are compiled to an executable with go build
- Created Thursday, May 5th 2016 @ 14:17:07
@jim could you remove the test that makes sure there is only one folder? It might work with a
- Created Thursday, May 5th 2016 @ 14:17:34
Or maybe just a way to run an executable file. Go is easy to cross compile
- Created Monday, May 9th 2016 @ 08:52:06
It's not a test. It is just the way the compiler works. I can't remember exactly why, because I implemented it a long time ago, but it was the only way it would work.
- Created Wednesday, January 11th 2017 @ 02:28:48
Hi, guys! Thank you for your great work, first of all, it is really intriguing. But, I tried to upload the golang bot, and get the same error "named files must all be in one directory".
Is it still broken for 3 years? Do you have any intentions to fix this?
This is not how language intent to work. https://golang.org/doc/code.html#Organization
The second is after I did all the mess with moving all src's in one dir I got bunches of these: "src/somesrc.go:4:3: cannot find package "blablabla" in any of"
Does engine do "go get"?
If it is possible to deal with a compleate mess in one dir and blood from eyes when you trying to organise it, it is compleatly impossible not to use packages!
Thanks again, hope, you'll answer.
- Created Wednesday, January 11th 2017 @ 08:49:44
We're not going to fix this for now. This website will only get fixes and updates that are absolutely critical. We're currently transitioning to our new platform Riddles.io. Riddles doesn't support golang yet, but it's on our todo list. And this time we have a much more flexible environment to run the bots in, so I'm sure we can support it the way you described.
- Created Wednesday, January 11th 2017 @ 10:59:32
Thank you so much for the answer! And this is really inspiring one, hope you will be lucky in this =)