Skip to content

Commit a2faa07

Browse files
committed
Rename variables to use snakeCase (golang idiomatic)
1 parent e938d7e commit a2faa07

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

legacy/builder/container_find_includes.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -361,33 +361,33 @@ func findIncludesUntilDone(ctx *types.Context, cache *includeCache, sourceFileQu
361361
}
362362
}
363363

364-
var preproc_err error
365-
var preproc_stderr []byte
364+
var preprocErr error
365+
var preprocStderr []byte
366366

367367
if unchanged && cache.valid {
368368
include = cache.Next().Include
369369
if first && ctx.Verbose {
370370
ctx.Info(tr("Using cached library dependencies for file: %[1]s", sourcePath))
371371
}
372372
} else {
373-
var preproc_stdout []byte
374-
preproc_stdout, preproc_stderr, preproc_err = preprocessor.GCC(sourcePath, targetFilePath, includeFolders, ctx.BuildProperties)
373+
var preprocStdout []byte
374+
preprocStdout, preprocStderr, preprocErr = preprocessor.GCC(sourcePath, targetFilePath, includeFolders, ctx.BuildProperties)
375375
if ctx.Verbose {
376-
ctx.WriteStdout(preproc_stdout)
377-
ctx.WriteStdout(preproc_stderr)
376+
ctx.WriteStdout(preprocStdout)
377+
ctx.WriteStdout(preprocStderr)
378378
}
379379
// Unwrap error and see if it is an ExitError.
380-
_, is_exit_error := errors.Cause(preproc_err).(*exec.ExitError)
381-
if preproc_err == nil {
380+
_, isExitErr := errors.Cause(preprocErr).(*exec.ExitError)
381+
if preprocErr == nil {
382382
// Preprocessor successful, done
383383
include = ""
384-
} else if !is_exit_error || preproc_stderr == nil {
384+
} else if !isExitErr || preprocStderr == nil {
385385
// Ignore ExitErrors (e.g. gcc returning
386386
// non-zero status), but bail out on
387387
// other errors
388-
return errors.WithStack(preproc_err)
388+
return errors.WithStack(preprocErr)
389389
} else {
390-
include = IncludesFinderWithRegExp(string(preproc_stderr))
390+
include = IncludesFinderWithRegExp(string(preprocStderr))
391391
if include == "" && ctx.Verbose {
392392
ctx.Info(tr("Error while detecting libraries included by %[1]s", sourcePath))
393393
}
@@ -403,23 +403,23 @@ func findIncludesUntilDone(ctx *types.Context, cache *includeCache, sourceFileQu
403403
library := ResolveLibrary(ctx, include)
404404
if library == nil {
405405
// Library could not be resolved, show error
406-
if preproc_err == nil || preproc_stderr == nil {
406+
if preprocErr == nil || preprocStderr == nil {
407407
// Filename came from cache, so run preprocessor to obtain error to show
408-
var preproc_stdout []byte
409-
preproc_stdout, preproc_stderr, preproc_err = preprocessor.GCC(sourcePath, targetFilePath, includeFolders, ctx.BuildProperties)
408+
var preprocStdout []byte
409+
preprocStdout, preprocStderr, preprocErr = preprocessor.GCC(sourcePath, targetFilePath, includeFolders, ctx.BuildProperties)
410410
if ctx.Verbose {
411-
ctx.WriteStdout(preproc_stdout)
411+
ctx.WriteStdout(preprocStdout)
412412
}
413-
if preproc_err == nil {
413+
if preprocErr == nil {
414414
// If there is a missing #include in the cache, but running
415415
// gcc does not reproduce that, there is something wrong.
416416
// Returning an error here will cause the cache to be
417417
// deleted, so hopefully the next compilation will succeed.
418418
return errors.New(tr("Internal error in cache"))
419419
}
420420
}
421-
ctx.WriteStderr(preproc_stderr)
422-
return errors.WithStack(preproc_err)
421+
ctx.WriteStderr(preprocStderr)
422+
return errors.WithStack(preprocErr)
423423
}
424424

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

0 commit comments

Comments
 (0)