Skip to content

Conversation

@dlevy-msft-sql
Copy link
Contributor

Summary

Fixes several linting warnings that have accumulated in the codebase.

Fixed Issues

File Issue Fix
\internal/io/file/file.go\ \io/ioutil\ deprecated since Go 1.19 Replaced with \os.ReadFile\
\internal/credman/credman_windows.go\ Redundant capacity in \make\ Simplified to \make([]*Credential, count)\
\internal/credman/credman_windows_test.go\ Unchecked errors Explicitly ignored with _ =\

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)
  • Unchecked \credFree.Call\ error in defer statement (line 75)

These should be addressed in a separate PR with proper testing.

Testing

  • All tests pass
  • Build succeeds

- 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.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.ReadFile with os.ReadFile and cleaned up import ordering in the file I/O helper.
  • Simplified make usage in EnumerateCredentials by 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.

@dlevy-msft-sql dlevy-msft-sql self-assigned this Jan 25, 2026
@dlevy-msft-sql dlevy-msft-sql added Size: S Small issue (less than one week effort) go Pull requests that update go code labels Jan 25, 2026
@dlevy-msft-sql dlevy-msft-sql added this to the v1.9.2 milestone Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update go code Size: S Small issue (less than one week effort)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant