Is there any way to execute a Go function from C#? For Python I would use Ironpython for example.
I know that I could spawn a process to execute a Go script, but I don't really want to fallback to such a solution, if possible.
A Google search didn't reveal anything, so is there any way to do that using an API? Or do I have to fallback on processes?
I don't think you're going to have much luck finding what you're looking for. Go is statically linked and C# doesn't support that.
From C#, calling a pre-compiled executable and reading the output is the easiest thing I can think of.
I think Frank's answer is not right! Golang supports many build mode, and one is c-shared mode, it means you can use it like a c module. e.g: https://www.trs.ai/c%E8%B0%83%E7%94%A8golang%E4%BB%A3%E7%A0%81/
you can use grpc implement calls
grpc works across languages and platforms