mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-06 19:06:42 +01:00
Add lint checks: gofmt, goimports, golint
- gofmt - Gofmt checks whether code was gofmt-ed. By default this tool runs
with -s option to check for code simplification
- goimports - Goimports does everything that gofmt does. Additionally it checks
unused imports
- golint - Golint differs from gofmt. Gofmt reformats Go source code, whereas
golint prints out style mistakes
- checks the uncommented exported functions & types
Update the code to fix the lint checks.
This commit is contained in:
@@ -62,7 +62,7 @@ func Init(levelStr, errorsPath string) {
|
||||
|
||||
if errorsPath != "" {
|
||||
log.Infof("file where errors will be written: %s", errorsPath)
|
||||
errorsFile, err = os.OpenFile(errorsPath, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644)
|
||||
errorsFile, err = os.OpenFile(errorsPath, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644) //nolint:gosec
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -76,7 +76,7 @@ func writeToErrorsFile(msg string) {
|
||||
return
|
||||
}
|
||||
//nolint:errcheck
|
||||
errorsFile.WriteString(fmt.Sprintf("%s %s\n", time.Now().Format(time.RFC3339), msg))
|
||||
errorsFile.WriteString(fmt.Sprintf("%s %s\n", time.Now().Format(time.RFC3339), msg)) //nolint:gosec
|
||||
}
|
||||
|
||||
// Debug calls log.Debug
|
||||
|
||||
Reference in New Issue
Block a user