Skip to content

fix: return the correct error on io.CopyN failure#4652

Open
joonas wants to merge 1 commit intozarf-dev:mainfrom
joonas:fix/return-copyerr
Open

fix: return the correct error on io.CopyN failure#4652
joonas wants to merge 1 commit intozarf-dev:mainfrom
joonas:fix/return-copyerr

Conversation

@joonas
Copy link
Contributor

@joonas joonas commented Feb 27, 2026

Description

The code was erroneously returning err instead of copyErr, which will be set to nil from the os.OpenFile above.

Instead, I believe the intent was to return copyErr if it is an unexpected error (i.e. not io.EOF).

Related Issue

Sorry, I didn't create an issue for this.

Checklist before merging

Signed-off-by: Joonas Bergius <joonas@defenseunicorns.com>
@joonas joonas requested review from a team as code owners February 27, 2026 15:48
@netlify
Copy link

netlify bot commented Feb 27, 2026

Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit b26e63a
🔍 Latest deploy log https://app.netlify.com/projects/zarf-docs/deploys/69a1bcea1453ca0008e39980

Copy link
Member

@brandtkeller brandtkeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch!

@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/internal/split/split.go 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/internal/split/split.go 31.25% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants