Replies: 1 comment
-
I use embed package for this purpose. //go:embed path/to/embedded/binary
var embedFs embed.FS
func main() {
// omitted for brevity: file existence check, file closing, error handling
embeddedFile, _ := embedFs.Open("path/to/embedded/binary")
realFile, _ := os.Create("path/to/real/binary")
realFile.ReadFrom(embeddedFile)
// do whatever you need with real file path, e.g. execute it:
exec.Command("path/to/real/binary").Run()
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Beta Was this translation helpful? Give feedback.
All reactions