There are also some limitations like
The playground can use most of the standard library, with some exceptions. The only communication a playground program has to the outside world is by writing to standard output and standard error.
In the playground the time begins at 2009-11-10 23:00:00 UTC (determining the significance of this date is an exercise for the reader). This makes it easier to cache programs by giving them deterministic output.
There are also limits on execution time and on CPU and memory usage.
I’m not a Go Playground expert, but I’m assuming it has something to do with your use of cgo:
// #include "GraphBLAS.h"
I couldn’t find anything specifically on “does go support cgo in the playground” or “how to enable cgo in the playground”, but I suspect that is your problem. If, for example, you try to use cgo directly you will get the following result:
package play: build constraints exclude all Go files in /tmp/sandbox4004760245
Go build failed.
You can see in the source that cgo is disabled:
This is conjecture, but, I wonder if there’s an error in the toolchain that’s being swallowed, which is then causing downstream problems. I’m honestly not sure what happens if you build a project with cgo and have CGO_ENABLED=0 (I don’t use cgo personally). Also - check this answer out:
If you run the included playground link it will confirm that your problem is probably not execution time (compiling that playground link takes quite a while!). It might be worth opening an issue in the official go repo to see what they say. I’m assuming they’ll tell you that you’re out of luck with cgo but again, I have no experience with it.