ParseBoolean parses a Boolean ValueType into a Go bool (not particularly useful, but here for completeness) SYS-REQ-012, SYS-REQ-036, SYS-REQ-057, SYS-REQ-066
(b []byte)
| 2125 | // ParseBoolean parses a Boolean ValueType into a Go bool (not particularly useful, but here for completeness) |
| 2126 | // SYS-REQ-012, SYS-REQ-036, SYS-REQ-057, SYS-REQ-066 |
| 2127 | func ParseBoolean(b []byte) (bool, error) { |
| 2128 | switch { |
| 2129 | case bytes.Equal(b, trueLiteral): |
| 2130 | return true, nil |
| 2131 | case bytes.Equal(b, falseLiteral): |
| 2132 | return false, nil |
| 2133 | default: |
| 2134 | return false, MalformedValueError |
| 2135 | } |
| 2136 | } |
| 2137 | |
| 2138 | // ParseString parses a String ValueType into a Go string (the main parsing work is unescaping the JSON string) |
| 2139 | // SYS-REQ-014, SYS-REQ-038, SYS-REQ-060, SYS-REQ-063, SYS-REQ-067 |
no outgoing calls