Is it possible to call the Go compiler programmatically from within a Go binary without os.exec? I want to produce a binary and leave it on the filesystem, no linking required.

Written by
Link to Post by 

Basically, what the title says. I am making an updater program that fetches code from a repo under certain conditions. I want to be able to compile the repo (all code within which is Go), drop the binary on the filesystem, terminate the old, running version of that repo’s binary, and launch the new one.

I can absolutely call os.exec and run the Go compiler that way, but I was wondering if there is a way to do this without spawning child processes.

submitted by /u/PM_ME_YOUR_REPO
[link] [comments]

Article Tags:
· ·
Article Categories:

Leave a Reply