dr2chase / bent

Benchmark and test getter + runner
BSD 3-Clause "New" or "Revised" License
28 stars 4 forks source link

bent: cmd.Output error may not be ExitError #4

Open prattmic opened 3 years ago

prattmic commented 3 years ago

From exec.Cmd.Output: "Any returned error will usually be of type ExitError." When the binary cannot be found, the error is actually exec.Error.

Allow for non-ExitError rather than panicking.

Before:

( GOMAXPROCS=4 GOPATH=/root/bent/scratch/gopath GOOS=linux GOARCH=arm64 GO111MODULE=auto go get -d -t -v github.com/dr2chase/benchmarks/klauspost ) panic: interface conversion: error is exec.Error, not exec.ExitError

goroutine 1 [running]: main.main() /root/bent/bent.go:562 +0x6e8c

After:

( GOMAXPROCS=4 GOPATH=/root/bent/scratch/gopath GOOS=linux GOARCH=arm64 GO111MODULE=auto go get -d -t -v github.com/egonelbre/spexs2/_benchmark ) There was an error running 'go get': exec: "go": executable file not found in $PATH DISABLING benchmark spexs2 rm -rf /root/bent/scratch/goroots/Tip/ ...