diff options
Diffstat (limited to 'file.go')
| -rw-r--r-- | file.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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)) } |
