我的問題如下:我在機(jī)器上有一個(gè)二進(jìn)制文件從那個(gè)二進(jìn)制文件我需要編譯一個(gè)外部 .go 文件編譯后,我需要將編譯后的 go 文件鏈接到當(dāng)前的二進(jìn)制文件中,以便我可以使用剛剛編譯的 go 代碼。你認(rèn)為這可能嗎?我做了一些研究,似乎不可能,但我可能忽略了一些東西。謝謝 :)第一個(gè) go 二進(jìn)制文件將包含類似的內(nèi)容func main() { // Here I need to compile an external go file (or package) which contains // The definition of runFoo() // Once the file/package is compiled and linked I need to call the compiled code runFoo() // Continue the execution process normally here}
從 go 二進(jìn)制文件動(dòng)態(tài)構(gòu)建和鏈接
函數(shù)式編程
2021-07-01 10:00:29