Files
core/internal/testhelper/testhelper.go
2022-06-24 19:49:53 +02:00

20 lines
352 B
Go

package testhelper
import (
"fmt"
"os/exec"
"path/filepath"
)
func BuildBinary(name, pathprefix string) (string, error) {
dir := filepath.Join(pathprefix, name)
aout := filepath.Join(dir, name)
err := exec.Command("go", "build", "-o", aout, dir).Run()
if err != nil {
return "", fmt.Errorf("build command: %w", err)
}
return aout, nil
}