The issue I'm having is mentioned on https://github.com/FactoKit/FactoCord/issues/3
For some reason I can't get StdinPipe working correctly on windows but it works perfectly fine on linux and I'm unsure why.
评论:
epiris:
FMCore:Need more info like a link to where in code it happens, sounds line an os.Exec on a prog that is exiting without reading from stdin fully or at all.. if so show me the exec statement. Likely need to change how you exec the program in windows or are getting permissions issues etc.
epiris:If I were to type in the console while the bot was connected, these lines trigger the error
https://github.com/FactoKit/FactoCord/blob/master/main.go#L81-L92
If I were to send a message on discord while the bot was connected, these lines would trigger an error: https://github.com/FactoKit/FactoCord/blob/master/main.go#L157-L161
Kraigius:You didn't include the command. Reduce all the noise into the simplest case is my best suggestion. Windows almost always boils down to acls or cmd syntax / availability with these sort of things, also I would capture the exit code, all stderr / stdout to teewriters for debugging.
I personally won't be able to help unless you reduce your code to the smallest reproducible case, we won't all set up a Factorio game server and create a Discord app to test it.
Although I don't think that's related to the error and I'm not the most experienced user when it comes to spotting race condition but you seems to have one with the Pipe variable here. If I'm wrong I hope someone will correct me so I can learn and I'll edit my message accordingly.
Pipe is a global in main.go. It's initialize inside a goroutine on line 61. It's used in a second goroutine on line 88 (no guarantee that line 61 was executed at this point), line 105 will execute before the 2 goroutine as it's synchronous code and so line 112 will pass the address of an uninitialized pipe to the admin.P global.
