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

Function cloneTime

internal/config/refreshable.go:769–774  ·  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

767// cloneTime returns a pointer to a copy of t, or nil when t is nil, so callers moving timestamps between the record
768// and gh.Credential never share the underlying *time.Time.
769func cloneTime(t *time.Time) *time.Time {
770 if t == nil {
771 return nil
772 }
773 return new(*t)
774}
775
776// normalizeToUTC returns a copy of the record with any expiration timestamps converted to UTC, so stored records use
777// 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