The range loop 'for _, attachment := range attachments' copied each
element by value. Assigning attachment.Checksum inside the loop only
modified the local copy; the original slice element was never updated.
All returned attachments had empty Checksum fields, causing every
attachment to be treated as changed on every run (the checksum
comparison would never match).
Switch to an index-based loop so the checksum is written directly to
the slice element.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Two issues in attachment handling:
1. GetAttachments failure called panic(err) instead of returning an
error, crashing the process on any API failure.
2. The 'keeping unmodified' log loop indexed into the original
attachments slice using the range of existing, causing wrong names
to be logged and a potential out-of-bounds panic when existing is
longer than attachments.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>