aboutsummaryrefslogtreecommitdiff
path: root/file.go
diff options
context:
space:
mode:
Diffstat (limited to 'file.go')
-rw-r--r--file.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/file.go b/file.go
index b8a5630..5609cfd 100644
--- a/file.go
+++ b/file.go
@@ -11,10 +11,14 @@ import (
"slices"
)
+// REUSE-IgnoreStart
+
// reLicenseID regex to detect SPDX license identifier with or without
// comment prefix.
var reLicenseID = regexp.MustCompile(`^(//+|#+|/\*+|<!--+)?\s?SPDX-License-Identifier:.*$`)
+// REUSE-IgnoreEnd
+
type file struct {
path string
@@ -147,8 +151,10 @@ func (f *file) applyLicenseID(conv *SPDXConv) {
if licenseID == `` {
licenseID = conv.cfg.LicenseIdentifier
}
+ // REUSE-IgnoreStart
line := fmt.Sprintf("%sSPDX-License-Identifier: %s%s",
f.commentPrefix, licenseID, f.commentSuffix)
+ // REUSE-IgnoreEnd
f.insertLicenseID([]byte(line))
}