Get returns the credential for the given server URL, or nil if none exists. URL is canonicalized (trailing slash + whitespace stripped) before lookup. Nil-receiver safe — callers can write `store.Get(url)` without a prior nil check on store.
(serverURL string)
| 172 | // before lookup. Nil-receiver safe — callers can write |
| 173 | // `store.Get(url)` without a prior nil check on store. |
| 174 | func (s *CredentialStore) Get(serverURL string) *Credentials { |
| 175 | if s == nil || s.Credentials == nil { |
| 176 | return nil |
| 177 | } |
| 178 | return s.Credentials[normalizeServerURL(serverURL)] |
| 179 | } |
| 180 | |
| 181 | // Set adds or replaces the credential for the given server URL. The |
| 182 | // canonical URL is mirrored into the value's ServerURL field so a |