MCPcopy Create free account
hub / github.com/GetStream/stream-go2 / MarshalJSON

Method MarshalJSON

types.go:41–43  ·  view source on GitHub ↗

MarshalJSON marshals the Duration to a string like "30s".

()

Source from the content-addressed store, hash-verified

39
40// MarshalJSON marshals the Duration to a string like "30s".
41func (d Duration) MarshalJSON() ([]byte, error) {
42 return json.Marshal(d.String())
43}
44
45func durationFromString(s string) (Duration, error) {
46 dd, err := time.ParseDuration(s)

Callers

nothing calls this directly

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected