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

Function cloneTime

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

593// cloneTime returns a pointer to a copy of t, or nil when t is nil, so callers moving timestamps between the record
594// and gh.Credential never share the underlying *time.Time.
595func cloneTime(t *time.Time) *time.Time {
596 if t == nil {
597 return nil
598 }
599 return new(*t)
600}
601
602// normalizeToUTC returns a copy of the record with any expiration timestamps converted to UTC, so stored records use
603// 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