Open
Conversation
- Replace deprecated io/ioutil with os.ReadFile in internal/io/file - Simplify make([]*Credential, count, count) to make([]*Credential, count) - Explicitly ignore errors in test cleanup/setup for credman tests Remaining warnings are for unsafe pointer handling in credman which requires careful review before modifying.
There was a problem hiding this comment.
Pull request overview
This PR resolves several Go linting warnings in the Windows credential manager and file I/O utilities without changing runtime behavior.
Changes:
- Replaced deprecated
ioutil.ReadFilewithos.ReadFileand cleaned up import ordering in the file I/O helper. - Simplified
makeusage inEnumerateCredentialsby removing redundant capacity specification and adjusted import ordering. - Updated tests for the Windows credential manager to explicitly ignore setup/cleanup errors to satisfy linting while preserving original behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
internal/io/file/file.go |
Replaces deprecated ioutil.ReadFile with os.ReadFile and reorders imports to follow Go style. |
internal/credman/credman_windows_test.go |
Reorders imports and explicitly discards return values for WriteCredential/DeleteCredential where errors are intentionally ignored. |
internal/credman/credman_windows.go |
Reorders imports and simplifies slice allocation in EnumerateCredentials by removing unnecessary capacity argument. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes several linting warnings that have accumulated in the codebase.
Fixed Issues
Remaining Warnings
The following warnings are not addressed in this PR as they involve complex unsafe pointer handling that requires careful review:
eflect.SliceHeader\ misuse in credman_windows.go (lines 76, 136)
These should be addressed in a separate PR with proper testing.
Testing