forked from gitleaks/gitleaks
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor cleanup to error handling and logging (gitleaks#985)
* silence warning about unchecked errors * go-fmt change to add newline * Zerolog requires you to always call .Msg() When logging with zerolog, you need to always end with .Msg(), even if you just pass an empty string. If you read the README on https://github.com/rs/zerolog, they write: > It is very important to note that when using the zerolog > chaining API, as shown above (log.Info().Msg("hello world"), the > chain must have either the Msg or Msgf method call. If you > forget to add either of these, the log will not occur and there > is no compile time error to alert you of this. * Create empty slice without literal * Fix variable / package name collision with literal instead of having a variable named "config", which collides with the package name "config", just pass a literal config.Config{} struct to the function * Replace call to deprecated ioutil.ReadAll() Use io.ReadAll() instead * Check error when closing jsonFile Make it a warning and log error
- Loading branch information
Showing
6 changed files
with
41 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters