-
Notifications
You must be signed in to change notification settings - Fork 488
Suggest io.SeekXXX instead of os.SEEK_XXX #302
Conversation
Implement a new lint function to suggest new constant replacing a depreciated constant. os.SEEK_SET => io.SeekStart os.SEEK_CUR => io.SeekCurrent os.SEEK_END => io.SeekEnd Fixes golang#294
Also, it's missing the error reporting convention with line number, I'm working on it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks fine overall. Please make this one small change.
lint.go
Outdated
@@ -210,6 +210,7 @@ func (f *file) lint() { | |||
f.lintTimeNames() | |||
f.lintContextKeyTypes() | |||
f.lintContextArgs() | |||
f.lintDepreciatedConstants() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename Depreciated as Deprecated.
Depreciate means to lower in value. Deprecated means to express disapproval of.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing. Updated with #e8b641
Friendly ping @dsnet, the small change you requested has been done, what's next? |
} | ||
|
||
// lintDeprecatedConstants checks for the use of a deprecated constant | ||
// and suggest a different constant in replacement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/suggest/suggests
Also comments should have a period at the end (was lint
run on the code? ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also merge conflicts need to be resolved.
@dsnet fair. Since both fall outside the scope of the tool, closing this one as well. |
Implement a new lint function to suggest new constant replacing a depreciated constant.
os.SEEK_SET => io.SeekStart
os.SEEK_CUR => io.SeekCurrent
os.SEEK_END => io.SeekEnd
Fixes #294
Hi! @shurcooL @dsnet
Can you please review it?