Skip to content

Commit b7fe792

Browse files
committed
Simplified if construct
1 parent a668203 commit b7fe792

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Diff for: legacy/builder/container_find_includes.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -372,14 +372,11 @@ func findIncludesUntilDone(ctx *types.Context, cache *includeCache, sourceFileQu
372372
ctx.WriteStdout(preprocStderr)
373373
}
374374
// Unwrap error and see if it is an ExitError.
375-
_, isExitErr := errors.Cause(preprocErr).(*exec.ExitError)
376375
if preprocErr == nil {
377376
// Preprocessor successful, done
378377
missingIncludeH = ""
379-
} else if !isExitErr || preprocStderr == 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(preprocErr).(*exec.ExitError); !isExitErr || preprocStderr == nil {
379+
// Ignore ExitErrors (e.g. gcc returning non-zero status), but bail out on other errors
383380
return errors.WithStack(preprocErr)
384381
} else {
385382
missingIncludeH = IncludesFinderWithRegExp(string(preprocStderr))

0 commit comments

Comments
 (0)