(b []byte, p unsafe.Pointer)
| 225 | } |
| 226 | |
| 227 | func (d decoder) decodeFloat32(b []byte, p unsafe.Pointer) ([]byte, error) { |
| 228 | if hasNullPrefix(b) { |
| 229 | return b[4:], nil |
| 230 | } |
| 231 | |
| 232 | v, r, _, err := d.parseNumber(b) |
| 233 | if err != nil { |
| 234 | return d.inputError(b, float32Type) |
| 235 | } |
| 236 | |
| 237 | f, err := strconv.ParseFloat(*(*string)(unsafe.Pointer(&v)), 32) |
| 238 | if err != nil { |
| 239 | return d.inputError(b, float32Type) |
| 240 | } |
| 241 | |
| 242 | *(*float32)(p) = float32(f) |
| 243 | return r, nil |
| 244 | } |
| 245 | |
| 246 | func (d decoder) decodeFloat64(b []byte, p unsafe.Pointer) ([]byte, error) { |
| 247 | if hasNullPrefix(b) { |
nothing calls this directly
no test coverage detected