I want to build chromium
into a go executable file with go build
, so that users can run the executable file without installing chromium
.
// my go code snippets
...
import "github.com/chromedp/chromedp"
opts := []chromedp.ExecAllocatorOption{
chromede.ExecPath("./chromium")
}
...
In my study, go:embed
might solve my problem. However, I haven't found any examples for embedding executable files, just for embedding data files (ex: csv, txt, ...).
I have two questions,
- How to build an executable file into a go executable?
- Is that a common practice? Or it's the user responsibility to install the dependencies.