(b []byte)
| 375 | } |
| 376 | |
| 377 | func (ct *FTime) UnmarshalJSON(b []byte) error { |
| 378 | // Remove quotes |
| 379 | s := strings.Trim(string(b), `"`) |
| 380 | if s == "" || s == "null" { |
| 381 | ct.Time = time.Unix(0, 0).UTC() |
| 382 | return nil |
| 383 | } |
| 384 | // Try to parse using RFC3339 |
| 385 | t, err := time.Parse(time.RFC3339, s) |
| 386 | if err != nil { |
| 387 | // Default to 1970-01-01T00:00:00Z |
| 388 | ct.Time = time.Unix(0, 0).UTC() |
| 389 | return nil |
| 390 | } |
| 391 | ct.Time = t |
| 392 | return nil |
| 393 | } |
| 394 | |
| 395 | var ( |
| 396 | configData *config.Config |
nothing calls this directly
no outgoing calls
no test coverage detected