From f94593e572e0355a9565c8705937036bbe6bd085 Mon Sep 17 00:00:00 2001 From: jonasbn Date: Mon, 13 Feb 2023 19:40:02 +0100 Subject: [PATCH] Cleaned up the code a bit more, based on feedback from go-critic --- main.go | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/main.go b/main.go index 52e6041..93d7cb4 100644 --- a/main.go +++ b/main.go @@ -100,15 +100,12 @@ func realMain() int { fmt.Printf("ignorelines: \n%s\n\n", ignoreLines) } - } else { - - if ignoreFile == "" { - ignoreFile = path + "/.dockerignore" + } else if ignoreFile == "" { + ignoreFile = path + "/.dockerignore" - if debug { - fmt.Println("path: ", path) - fmt.Println("ignoreFile: ", ignoreFile) - } + if debug { + fmt.Println("path: ", path) + fmt.Println("ignoreFile: ", ignoreFile) } } @@ -182,10 +179,8 @@ func realMain() int { ownIgnoreObject = ignore.CompileIgnoreLines([]string{}...) } - } else { - if debug { - fmt.Println("No stevedore ignorefile found") - } + } else if debug { + fmt.Println("No stevedore ignorefile found") } err = filepath.Walk(path, func(path string, info fs.FileInfo, err error) error {