Skip to content

Drop the dead reader assignment in untar - #382

Merged
folbricht merged 1 commit into
masterfrom
untar-ineffassign
Aug 4, 2026
Merged

Drop the dead reader assignment in untar#382
folbricht merged 1 commit into
masterfrom
untar-ineffassign

Conversation

@folbricht

Copy link
Copy Markdown
Owner

In the catar branch of runUntar(), r was declared as the opened file and then overwritten with the io.TeeReader wrapping that same file, before r was ever read. The initial value was always dead.

Dropped the variable and passed the TeeReader directly to UnTar(). No behaviour change.

Reported by ineffassign (part of golangci-lint's default set).

r was declared as the file, then immediately overwritten with the
TeeReader wrapping it before its only use. Pass the TeeReader directly.
@folbricht
folbricht merged commit 9cadad4 into master Aug 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant