summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2026-01-15 17:20:54 +0700
committerShulhan <ms@kilabit.info>2026-01-15 17:25:46 +0700
commitb1f8d27c7e22eb5624c56e890e51f0a34c7b9606 (patch)
tree4231f6e8d52296c9e3f251594da3274abd037e5d
parentf8a08c8a55efbaecc8a99bf39b63d85b3d89170d (diff)
downloadpakakeh.go-b1f8d27c7e22eb5624c56e890e51f0a34c7b9606.tar.xz
lib/test: ignore line prefixed with "//"
The first line in test data file may contains line prefixed with "//" as comment. The use case is for license and copyright lines.
-rw-r--r--CHANGELOG.adoc6
-rw-r--r--lib/test/data.go4
2 files changed, 10 insertions, 0 deletions
diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc
index 297a1e8e..ced0db0a 100644
--- a/CHANGELOG.adoc
+++ b/CHANGELOG.adoc
@@ -60,6 +60,12 @@ author name, author email, and subject; respectively separated by comma.
The IgnorePattern is not exclusive to git only. Some program, like
REUSE, use the same pattern in the REUSE.toml path configuration.
+**🌼 lib/test: ignore line prefixed with "//"**
+
+The first line in test data file may contains line prefixed with "//"
+as comment.
+The use case is for license and copyright lines.
+
//}}}
//{{{
[#v0_60_2]
diff --git a/lib/test/data.go b/lib/test/data.go
index d113e87c..accbc94b 100644
--- a/lib/test/data.go
+++ b/lib/test/data.go
@@ -271,6 +271,10 @@ func (data *Data) parse(content []byte) (err error) {
for x < len(lines) {
content = lines[x]
if state == stateFlag {
+ if bytes.HasPrefix(content, []byte("//")) {
+ x++
+ continue
+ }
if len(content) == 0 {
x++
continue