Fix noinlineerr findings: internal/crypto (refs #61)

This commit is contained in:
2026-08-07 16:59:56 +00:00
parent 1ee0d291ca
commit dca3c50cd2
2 changed files with 24 additions and 11 deletions

View File

@@ -62,12 +62,14 @@ func (e *Encryptor) Encrypt(data []byte) ([]byte, error) {
}
// Write data
if _, err := w.Write(data); err != nil {
_, err = w.Write(data)
if err != nil {
return nil, fmt.Errorf("writing encrypted data: %w", err)
}
// Close to flush
if err := w.Close(); err != nil {
err = w.Close()
if err != nil {
return nil, fmt.Errorf("closing encrypted writer: %w", err)
}
@@ -90,12 +92,14 @@ func (e *Encryptor) EncryptStream(dst io.Writer, src io.Reader) error {
}
// Copy data
if _, err := io.Copy(w, src); err != nil {
_, err = io.Copy(w, src)
if err != nil {
return fmt.Errorf("copying encrypted data: %w", err)
}
// Close to flush
if err := w.Close(); err != nil {
err = w.Close()
if err != nil {
return fmt.Errorf("closing encrypted writer: %w", err)
}