1 year ago

#375183

test-img

techjourneyman

Run go test using Golang's exec library

I am trying to run go test command using the exec library as this.

output, err := exec.Command("bash", "-c", "go test -v -run TestX ./test/*").Output()
    if err != nil {
        log.GetLogger().Error(err.Error())
    }

It is failing with exit status 1. The command runs fine from the command line. What am I missing here?

go

cmd

command

exec

go-testing

0 Answers

Your Answer

Accepted video resources