Skip to content

Commit e57d183

Browse files
committed
Simplified if construct
1 parent 3512263 commit e57d183

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

legacy/builder/container_find_includes.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -372,14 +372,11 @@ func findIncludesUntilDone(ctx *types.Context, cache *includeCache, sourceFileQu
372372
ctx.WriteStdout(preproc_stderr)
373373
}
374374
// Unwrap error and see if it is an ExitError.
375-
_, is_exit_error := errors.Cause(preproc_err).(*exec.ExitError)
376375
if preproc_err == nil {
377376
// Preprocessor successful, done
378377
include = ""
379-
} else if !is_exit_error || preproc_stderr == nil {
380-
// Ignore ExitErrors (e.g. gcc returning
381-
// non-zero status), but bail out on
382-
// other errors
378+
} else if _, isExitErr := errors.Cause(preproc_err).(*exec.ExitError); !isExitErr || preproc_stderr == nil {
379+
// Ignore ExitErrors (e.g. gcc returning non-zero status), but bail out on other errors
383380
return errors.WithStack(preproc_err)
384381
} else {
385382
include = IncludesFinderWithRegExp(string(preproc_stderr))

0 commit comments

Comments
 (0)