Skip to content

refactor: use pointer receivers on all scpUploadState methods - #366

Open
tenthirtyam wants to merge 1 commit into
hashicorp:mainfrom
tenthirtyam:refactor/pointer-receivers-scpuploadstate-methods
Open

tenthirtyam wants to merge 1 commit into
hashicorp:mainfrom
tenthirtyam:refactor/pointer-receivers-scpuploadstate-methods

Conversation

@tenthirtyam

@tenthirtyam tenthirtyam commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Description

Updates the method receivers for DestPath and SrcPath in the scpUploadState struct to use pointer receivers instead of value receivers. This change ensures consistency and allows these methods to work correctly if the struct is modified in the future. No other significant logic changes are introduced.

Both DestPath and SrcPath methods were the only methods on scpUploadState that used a value receiver. They only read fields, so behavior does not change. The other methods already use a pointer because they update the session. Using the same receiver on every method avoids mixing styles and makes it clear these helpers run on the same state, not a copy.

Rollback Plan

Revert commit.

Changes to Security Controls

None.

Both `DestPath` and `SrcPath` methods were the only methods on `scpUploadState` that used a value receiver. They only read fields, so behavior does not change. The other methods already use a pointer because they update the session. Using the same receiver on every method avoids mixing styles and makes it clear these helpers run on the same state, not a copy.

Signed-off-by: Ryan Johnson <ryan@tenthirtyam.org>
@tenthirtyam
tenthirtyam requested a review from a team as a code owner September 9, 2026 18:07
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