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)
| 1323 | // ParseBoolean parses a Boolean ValueType into a Go bool (not particularly useful, but here for completeness) |
| 1324 | // SYS-REQ-012, SYS-REQ-036, SYS-REQ-057, SYS-REQ-066 |
| 1325 | func ParseBoolean(b []byte) (bool, error) { |
| 1326 | switch { |
| 1327 | case bytes.Equal(b, trueLiteral): |
| 1328 | return true, nil |
| 1329 | case bytes.Equal(b, falseLiteral): |
| 1330 | return false, nil |
| 1331 | default: |
| 1332 | return false, MalformedValueError |
| 1333 | } |
| 1334 | } |
| 1335 | |
| 1336 | // ParseString parses a String ValueType into a Go string (the main parsing work is unescaping the JSON string) |
| 1337 | // SYS-REQ-014, SYS-REQ-038, SYS-REQ-060, SYS-REQ-063, SYS-REQ-067 |
no outgoing calls
searching dependent graphs…