Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SA1019: only first object in a declaration group gets marked as deprecated #1313

Closed
shmsr opened this issue Aug 19, 2022 · 1 comment
Closed

Comments

@shmsr
Copy link
Contributor

shmsr commented Aug 19, 2022

Consider the following case:

Reference: https://cs.opensource.google/go/go/+/refs/tags/go1.19:src/os/file.go;l=88

In "os" package, os.SEEK_SET, os.SEEK_CUR and os.SEEK_END are deprecated and are suggested to be replaced with: io.SeekStart, io.SeekCurrent, and io.SeekEnd.

// Seek whence values.
//
// Deprecated: Use io.SeekStart, io.SeekCurrent, and io.SeekEnd.
const (
	SEEK_SET int = 0 // seek relative to the origin of the file
	SEEK_CUR int = 1 // seek relative to the current offset
	SEEK_END int = 2 // seek relative to the end
)

Currently, the fact_deprecated analyzer is unable to detect SEEK_CUR and SEEK_END and just marks SEEK_SET as deprecated.

Because of this bug SA1019 check is also affected (there might be more).

@shmsr shmsr added false-negative needs-triage Newly filed issue that needs triage labels Aug 19, 2022
@shmsr shmsr changed the title Unhandled cases in fact_deprecated Unhandled cases in fact_deprecated analyzer Aug 19, 2022
@dominikh dominikh removed the needs-triage Newly filed issue that needs triage label Aug 19, 2022
@dominikh dominikh changed the title Unhandled cases in fact_deprecated analyzer SA1019: only first object in a declaration group gets marked as deprecated Aug 19, 2022
@dominikh
Copy link
Owner

This was fixed in d6e5ad4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants