aboutsummaryrefslogtreecommitdiffstats
path: root/ccl.go
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2025-11-24 16:12:09 -0800
committerRose Hogenson <rosehogenson@posteo.net>2025-11-24 16:18:03 -0800
commit36acb0052bde87b82fb6c08d3a57680f8bea4e5f (patch)
treeb3428f0b79f53e0b4fde4a3ffef505ec486e759b /ccl.go
parentc61422f65bf1859da9336d764bb328b1882ec287 (diff)
downloadccl-36acb0052bde87b82fb6c08d3a57680f8bea4e5f.tar.zst
Only allow "true" and "false" for bool
Diffstat (limited to 'ccl.go')
-rw-r--r--ccl.go14
1 files changed, 4 insertions, 10 deletions
diff --git a/ccl.go b/ccl.go
index eea772c..1333119 100644
--- a/ccl.go
+++ b/ccl.go
@@ -96,23 +96,17 @@
//
// # Bool
//
-// Bool values can be true or false (classic), and are written using one of the
-// below strings.
+// Bool values can be true or false (classic).
//
// true
-// yes
-// on
-//
// false
-// no
-// off
//
// # Lists
//
// Lists are written with square brackets and elements are separated by comma.
//
// [1, 2, 3]
-// [{nested: "messages"}, {are: "also"}, {allowed: yes}]
+// [{nested: "messages"}, {are: "also"}, {allowed: "yep"}]
//
// Trailing comma is allowed
//
@@ -531,9 +525,9 @@ func (p *parser) parseVal(fieldVal reflect.Value, tok, field []byte) error {
return nil
}
switch string(tok) {
- case "true", "yes", "on":
+ case "true":
return p.unpackBool(fieldVal, true, field)
- case "false", "no", "off":
+ case "false":
return p.unpackBool(fieldVal, false, field)
}
if bytes.ContainsAny(tok, ".eE") {