Skip to content

Commit f57ac04

Browse files
committed
Rename variables to use snakeCase (golang idiomatic)
1 parent a2b03ae commit f57ac04

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

legacy/builder/container_find_includes.go

+17-17
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,8 @@ func findIncludesUntilDone(ctx *types.Context, cache *includeCache, sourceFileQu
355355
}
356356
}
357357

358-
var preproc_err error
359-
var preproc_stderr []byte
358+
var preprocErr error
359+
var preprocStderr []byte
360360

361361
var include string
362362
if unchanged && cache.valid {
@@ -365,21 +365,21 @@ func findIncludesUntilDone(ctx *types.Context, cache *includeCache, sourceFileQu
365365
ctx.Info(tr("Using cached library dependencies for file: %[1]s", sourcePath))
366366
}
367367
} else {
368-
var preproc_stdout []byte
369-
preproc_stdout, preproc_stderr, preproc_err = preprocessor.GCC(sourcePath, targetFilePath, includeFolders, ctx.BuildProperties)
368+
var preprocStdout []byte
369+
preprocStdout, preprocStderr, preprocErr = preprocessor.GCC(sourcePath, targetFilePath, includeFolders, ctx.BuildProperties)
370370
if ctx.Verbose {
371-
ctx.WriteStdout(preproc_stdout)
372-
ctx.WriteStdout(preproc_stderr)
371+
ctx.WriteStdout(preprocStdout)
372+
ctx.WriteStdout(preprocStderr)
373373
}
374374
// Unwrap error and see if it is an ExitError.
375-
if preproc_err == nil {
375+
if preprocErr == nil {
376376
// Preprocessor successful, done
377377
include = ""
378-
} else if _, isExitErr := errors.Cause(preproc_err).(*exec.ExitError); !isExitErr || preproc_stderr == nil {
378+
} else if _, isExitErr := errors.Cause(preprocErr).(*exec.ExitError); !isExitErr || preprocStderr == nil {
379379
// Ignore ExitErrors (e.g. gcc returning non-zero status), but bail out on other errors
380-
return errors.WithStack(preproc_err)
380+
return errors.WithStack(preprocErr)
381381
} else {
382-
include = IncludesFinderWithRegExp(string(preproc_stderr))
382+
include = IncludesFinderWithRegExp(string(preprocStderr))
383383
if include == "" && ctx.Verbose {
384384
ctx.Info(tr("Error while detecting libraries included by %[1]s", sourcePath))
385385
}
@@ -395,23 +395,23 @@ func findIncludesUntilDone(ctx *types.Context, cache *includeCache, sourceFileQu
395395
library := ResolveLibrary(ctx, include)
396396
if library == nil {
397397
// Library could not be resolved, show error
398-
if preproc_err == nil || preproc_stderr == nil {
398+
if preprocErr == nil || preprocStderr == nil {
399399
// Filename came from cache, so run preprocessor to obtain error to show
400-
var preproc_stdout []byte
401-
preproc_stdout, preproc_stderr, preproc_err = preprocessor.GCC(sourcePath, targetFilePath, includeFolders, ctx.BuildProperties)
400+
var preprocStdout []byte
401+
preprocStdout, preprocStderr, preprocErr = preprocessor.GCC(sourcePath, targetFilePath, includeFolders, ctx.BuildProperties)
402402
if ctx.Verbose {
403-
ctx.WriteStdout(preproc_stdout)
403+
ctx.WriteStdout(preprocStdout)
404404
}
405-
if preproc_err == nil {
405+
if preprocErr == nil {
406406
// If there is a missing #include in the cache, but running
407407
// gcc does not reproduce that, there is something wrong.
408408
// Returning an error here will cause the cache to be
409409
// deleted, so hopefully the next compilation will succeed.
410410
return errors.New(tr("Internal error in cache"))
411411
}
412412
}
413-
ctx.WriteStderr(preproc_stderr)
414-
return errors.WithStack(preproc_err)
413+
ctx.WriteStderr(preprocStderr)
414+
return errors.WithStack(preprocErr)
415415
}
416416

417417
// Add this library to the list of libraries, the

0 commit comments

Comments
 (0)