diff options
| author | Shulhan <ms@kilabit.info> | 2026-01-15 17:20:54 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2026-01-15 17:25:46 +0700 |
| commit | b1f8d27c7e22eb5624c56e890e51f0a34c7b9606 (patch) | |
| tree | 4231f6e8d52296c9e3f251594da3274abd037e5d /lib/test/data.go | |
| parent | f8a08c8a55efbaecc8a99bf39b63d85b3d89170d (diff) | |
| download | pakakeh.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.
Diffstat (limited to 'lib/test/data.go')
| -rw-r--r-- | lib/test/data.go | 4 |
1 files changed, 4 insertions, 0 deletions
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 |
