From b7bde5ad619c068c0fc33757131f99284b58a4d6 Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Wed, 6 Sep 2023 14:18:48 +0200 Subject: [PATCH] appease golint --- arduino/builder/builder.go | 1 + arduino/builder/progress/progress.go | 4 ++++ arduino/builder/utils/utils.go | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arduino/builder/builder.go b/arduino/builder/builder.go index 5238d74d2ce..e8374b66e5a 100644 --- a/arduino/builder/builder.go +++ b/arduino/builder/builder.go @@ -17,6 +17,7 @@ package builder import "github.com/arduino/arduino-cli/arduino/sketch" +// nolint const ( BuildPropertiesArchiveFile = "archive_file" BuildPropertiesArchiveFilePath = "archive_file_path" diff --git a/arduino/builder/progress/progress.go b/arduino/builder/progress/progress.go index 278ce09c152..53a64e803bf 100644 --- a/arduino/builder/progress/progress.go +++ b/arduino/builder/progress/progress.go @@ -1,11 +1,13 @@ package progress +// Struct fixdoc type Struct struct { Progress float32 StepAmount float32 Parent *Struct } +// AddSubSteps fixdoc func (p *Struct) AddSubSteps(steps int) { p.Parent = &Struct{ Progress: p.Progress, @@ -18,12 +20,14 @@ func (p *Struct) AddSubSteps(steps int) { p.StepAmount /= float32(steps) } +// RemoveSubSteps fixdoc func (p *Struct) RemoveSubSteps() { p.Progress = p.Parent.Progress p.StepAmount = p.Parent.StepAmount p.Parent = p.Parent.Parent } +// CompleteStep fixdoc func (p *Struct) CompleteStep() { p.Progress += p.StepAmount } diff --git a/arduino/builder/utils/utils.go b/arduino/builder/utils/utils.go index d9455385d76..f5aad02c810 100644 --- a/arduino/builder/utils/utils.go +++ b/arduino/builder/utils/utils.go @@ -195,6 +195,7 @@ func FindFilesInFolder(dir *paths.Path, recurse bool, extensions ...string) (pat return dir.ReadDir(fileFilter) } +// nolint const ( Ignore = 0 // Redirect to null Show = 1 // Show on stdout/stderr as normal @@ -207,9 +208,8 @@ func printableArgument(arg string) string { arg = strings.ReplaceAll(arg, "\\", "\\\\") arg = strings.ReplaceAll(arg, "\"", "\\\"") return "\"" + arg + "\"" - } else { - return arg } + return arg } // Convert a command and argument slice back to a printable string.