diff options
| author | Rose Hogenson <rosehogenson@posteo.net> | 2025-11-24 16:12:09 -0800 |
|---|---|---|
| committer | Rose Hogenson <rosehogenson@posteo.net> | 2025-11-24 16:18:03 -0800 |
| commit | 36acb0052bde87b82fb6c08d3a57680f8bea4e5f (patch) | |
| tree | b3428f0b79f53e0b4fde4a3ffef505ec486e759b /ccl.go | |
| parent | c61422f65bf1859da9336d764bb328b1882ec287 (diff) | |
| download | ccl-36acb0052bde87b82fb6c08d3a57680f8bea4e5f.tar.zst | |
Only allow "true" and "false" for bool
Diffstat (limited to 'ccl.go')
| -rw-r--r-- | ccl.go | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -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") { |
