Skip to content

Commit

Permalink
fix(verification): don't create empty ExcludedFiles array (#230)
Browse files Browse the repository at this point in the history
Signed-off-by: DmitriyLewen <dmitriy.lewen@smartforce.io>
  • Loading branch information
DmitriyLewen committed Nov 8, 2023
1 parent be2fd61 commit 0c0f394
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion utils/verification.go
Expand Up @@ -44,9 +44,14 @@ func GetVerificationCode(files []*spdx.File, excludeFile string) (common.Package
hsha1.Write([]byte(shasConcat))
bs := hsha1.Sum(nil)

var excludedFiles []string
if excludeFile != "" {
excludedFiles = []string{excludeFile}
}

code := common.PackageVerificationCode{
Value: fmt.Sprintf("%x", bs),
ExcludedFiles: []string{excludeFile},
ExcludedFiles: excludedFiles,
}

return code, nil
Expand Down

0 comments on commit 0c0f394

Please sign in to comment.