From f793e74a0302f58698ee5520f1563b344049e6f5 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 24 Oct 2023 15:06:20 +0200 Subject: [PATCH] Lint --- cmd/construct.go | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/cmd/construct.go b/cmd/construct.go index 9d5c69a..d9702f0 100644 --- a/cmd/construct.go +++ b/cmd/construct.go @@ -121,15 +121,6 @@ func checkIfBasePackage(name string) bool { return stringInSlice(name, basePackages) } -func checkIfPackageOnOutputList(name string, outputList []PackageDescription) bool { - for _, o := range outputList { - if name == o.Package { - return true - } - } - return false -} - func checkIfSkipDependency(indentation string, packageName string, dependencyName string, versionOperator string, versionValue string, outputList *[]PackageDescription) bool { if checkIfBasePackage(dependencyName) { @@ -143,10 +134,16 @@ func checkIfSkipDependency(indentation string, packageName string, dependencyNam if dependencyName == (*outputList)[i].Package { // Dependency found on the output list. if checkIfVersionSufficient((*outputList)[i].Version, versionOperator, versionValue) { + var requirementMessage string + if versionOperator != "" && versionValue != "" { + requirementMessage = " according to the requirement " + versionOperator + " " + versionValue + } else { + requirementMessage = " since no required version has been specified." + } log.Debug( "Output list already contains dependency ", dependencyName, " version ", (*outputList)[i].Version, " which is sufficient for ", packageName, - " according to the requirement ", versionOperator, " ", versionValue, + requirementMessage, ) return true }