I expect this is a symptom of
https://github.com/pulumi/pulumi/issues/4139, which was fixed in the latest Pulumi CLI released yesterday.
This particular failure typically masks some actual error preventing your Go code from compiling or running correctly.