MCPcopy
hub / github.com/getsops/sops / Cleanup

Method Cleanup

pgp/keysource.go:182–187  ·  view source on GitHub ↗

Cleanup deletes the GnuPGHome if it passes Validate. It returns an error if the GnuPGHome does not pass Validate, or if the removal failed.

()

Source from the content-addressed store, hash-verified

180// It returns an error if the GnuPGHome does not pass Validate, or if the
181// removal failed.
182func (d GnuPGHome) Cleanup() error {
183 if err := d.Validate(); err != nil {
184 return err
185 }
186 return os.RemoveAll(d.String())
187}
188
189// Validate ensures the GnuPGHome is a valid GnuPG home directory path.
190// When validation fails, it returns a descriptive reason as error.

Calls 2

ValidateMethod · 0.95
StringMethod · 0.95

Tested by 15

TestGnuPGHome_CleanupFunction · 0.76
TestNewGnuPGHomeFunction · 0.64
TestGnuPGHome_ImportFunction · 0.64
TestGnuPGHome_ImportFileFunction · 0.64
TestGnuPGHome_ValidateFunction · 0.64
TestMasterKey_EncryptFunction · 0.64
TestMasterKey_DecryptFunction · 0.64