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

Function Delete

internal/keyring/keyring.go:62–77  ·  view source on GitHub ↗

Delete secret from keyring. It returns ErrNotFound when there is no such secret.

(service, user string)

Source from the content-addressed store, hash-verified

60
61// Delete secret from keyring. It returns ErrNotFound when there is no such secret.
62func Delete(service, user string) error {
63 ch := make(chan error, 1)
64 go func() {
65 defer close(ch)
66 ch <- keyring.Delete(service, user)
67 }()
68 select {
69 case err := <-ch:
70 if errors.Is(err, keyring.ErrNotFound) {
71 return ErrNotFound
72 }
73 return err
74 case <-time.After(60 * time.Second):
75 return &TimeoutError{"timeout while trying to delete secret from keyring"}
76 }
77}
78
79func MockInit() {
80 keyring.MockInit()

Callers 6

TestSwitchRunFunction · 0.92
loginRefreshableMethod · 0.92
logoutMethod · 0.92
setActiveCredentialMethod · 0.92

Calls 1

DeleteMethod · 0.65