MCPcopy Index your code
hub / github.com/coder/coder / MarshalJSON

Method MarshalJSON

coderd/httpapi/json.go:25–27  ·  view source on GitHub ↗

MarshalJSON implements json.Marshaler.

()

Source from the content-addressed store, hash-verified

23
24// MarshalJSON implements json.Marshaler.
25func (d Duration) MarshalJSON() ([]byte, error) {
26 return json.Marshal(time.Duration(d).String())
27}
28
29// UnmarshalJSON implements json.Unmarshaler.
30func (d *Duration) UnmarshalJSON(b []byte) error {

Callers 1

TestDurationFunction · 0.95

Calls 3

DurationMethod · 0.80
MarshalMethod · 0.45
StringMethod · 0.45

Tested by 1

TestDurationFunction · 0.76