Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/segmentio/encoding
/ MarshalJSON
Method
MarshalJSON
json/json_test.go:720–722 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
718
type
duration time.Duration
719
720
func
(d duration) MarshalJSON() ([]byte, error) {
721
return
[]byte(`
"` + time.Duration(d).String() + `"
`), nil
722
}
723
724
func
(d *duration) UnmarshalJSON(b []byte) error {
725
var
s string
Callers
nothing calls this directly
Calls
1
String
Method · 0.65
Tested by
no test coverage detected