Ok here is the Smaller Version … does not even need a container to replicate the Behaviour
Tested on a Mac (and a Ubuntu Container)
Darwin desktop-gv38ou7.uniserv.de 19.5.0 Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64
go version go1.14.4 darwin/amd64
We need 2 Files
File demo.go
package main
// #include <stdio.h>
// #include “demo.h”
// void answer(){
// fprintf(stderr,“the answer to life universe and everything is: %d\n”,ANSWER);
// }
import “C”func main() {
C.answer();
}
and a File demo.h
#define ANSWER 43
Now running the Programm using go run demo.go will give me the output
the answer to life universe and everything is: 43
Changing the Value ANSWER in demo.h to 42 and running it again with go run demo.go does NOT give me back the Value 42, it still gives me back
the answer to life universe and everything is: 43
but should be “42” … I even can change the File to invalid C-Code and I still get the Value
the answer to life universe and everything is: 43
Am I getting something wrong ?