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

Function NewNullTime

codersdk/time.go:21–28  ·  view source on GitHub ↗

NewNullTime returns a new NullTime with the given time.Time.

(t time.Time, valid bool)

Source from the content-addressed store, hash-verified

19
20// NewNullTime returns a new NullTime with the given time.Time.
21func NewNullTime(t time.Time, valid bool) NullTime {
22 return NullTime{
23 NullTime: sql.NullTime{
24 Time: t,
25 Valid: valid,
26 },
27 }
28}
29
30// MarshalJSON implements json.Marshaler.
31func (t NullTime) MarshalJSON() ([]byte, error) {

Callers 4

convertWorkspaceBuildMethod · 0.92
TestNullTime_MarshalJSONFunction · 0.92

Calls

no outgoing calls

Tested by 3

TestNullTime_MarshalJSONFunction · 0.74