MCPcopy Create free account
hub / github.com/Preloading/TwitterAPIBridge / UnmarshalJSON

Method UnmarshalJSON

bluesky/blueskyapi.go:377–393  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

375}
376
377func (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
395var (
396 configData *config.Config

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected