MCPcopy Create free account
hub / github.com/cli/cli / cloneTime

Function cloneTime

internal/config/refreshable.go:674–679  ·  view source on GitHub ↗

cloneTime returns a pointer to a copy of t, or nil when t is nil, so callers moving timestamps between the record and gh.Credential never share the underlying *time.Time.

(t *time.Time)

Source from the content-addressed store, hash-verified

672// cloneTime returns a pointer to a copy of t, or nil when t is nil, so callers moving timestamps between the record
673// and gh.Credential never share the underlying *time.Time.
674func cloneTime(t *time.Time) *time.Time {
675 if t == nil {
676 return nil
677 }
678 return new(*t)
679}
680
681// normalizeToUTC returns a copy of the record with any expiration timestamps converted to UTC, so stored records use
682// a single canonical timezone regardless of how the caller constructed them.

Callers 3

credentialMethod · 0.85
recordFromCredentialFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected