From 36acb0052bde87b82fb6c08d3a57680f8bea4e5f Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Mon, 24 Nov 2025 16:12:09 -0800 Subject: Only allow "true" and "false" for bool --- ccl.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'ccl.go') 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") { -- cgit v1.3.1