8000 simple: resolve package identity in S1003 by dajiaohuang · Pull Request #1755 · dominikh/go-tools · GitHub
[go: up one dir, main page]

Skip to content

simple: resolve package identity in S1003 - #1755

Open
dajiaohuang wants to merge 1 commit into
dominikh:masterfrom
dajiaohuang:fix/s1003-shadowed-package-names
Open

dajiaohuang wants to merge 1 commit into
dominikh:masterfrom
dajiaohuang:fix/s1003-shadowed-package-names

Conversation

@dajiaohuang
@dajiaohuang dajiaohuang commented Oct 1, 2026 •
Copy link
Copy Markdown

S1003 previously recognized calls by the source spelling of the receiver (strings or bytes). That produced diagnostics and suggested fixes for unrelated local values with methods named Index, IndexAny, or IndexRune, and missed aliased imports. Resolve the receiver identifier through type information and require an actual import of strings or bytes. The fix retains the source alias in the replacement.

Regression coverage checks both aliased strings imports and local values named strings and bytes.

Validation: go test ./simple/s1003 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

0