-
Notifications
You must be signed in to change notification settings - Fork 298
refactor: removes get
from getters names
#1373
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
Conversation
// GetPattern - returns the actual pattern | ||
func (p *LintPattern) GetPattern() string { | ||
// Pattern - returns the actual pattern | ||
func (p *LintPattern) Pattern() string { |
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.
This struct is exported, so you are updating the method name of something that could be used by someone.
And you don't provide a method with deprecated flag.
So I'm doubtful here.
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.
Thanks for the changes you made
lint/failure.go
Outdated
func (f *Failure) GetFilename() string { | ||
// Filename returns the filename. | ||
func (f *Failure) Filename() string { | ||
return f.Position.Start.Filename | ||
} |
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.
Same as
lint/failure.go
Outdated
// GetFilename returns the filename. | ||
// Deprecated: Use Filename. | ||
func (f *Failure) GetFilename() string { | ||
return f.Filename() | ||
} |
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.
If you want to respect specs, it should be in a separated paragraph.
// GetFilename returns the filename. | |
// Deprecated: Use Filename. | |
func (f *Failure) GetFilename() string { | |
return f.Filename() | |
} | |
// GetFilename returns the filename. | |
// | |
// Deprecated: Use Filename. | |
func (f *Failure) GetFilename() string { | |
return f.Filename() | |
} |
Also, you could use godoc link to help navigation
// GetFilename returns the filename. | |
// Deprecated: Use Filename. | |
func (f *Failure) GetFilename() string { | |
return f.Filename() | |
} | |
// GetFilename returns the filename. | |
// | |
// Deprecated: Use [Filename]. | |
func (f *Failure) GetFilename() string { | |
return f.Filename() | |
} |
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.
revivelib/pattern.go
Outdated
// GetPattern - returns the actual pattern | ||
// Deprecated: Use Pattern. |
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.
// GetPattern - returns the actual pattern | |
// Deprecated: Use Pattern. | |
// GetPattern - returns the actual pattern. | |
// | |
// Deprecated: Use [Pattern]. |
// GetPattern - returns the actual pattern | ||
func (p *LintPattern) GetPattern() string { | ||
// Pattern - returns the actual pattern | ||
func (p *LintPattern) Pattern() string { |
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.
Thanks for the changes you made
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.
Please fix comments and can be merged.
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.
LGTM. Thanks!
This PR removes the prefix
get
from getter methods (see Getters)Note: this PR includes modifications in 3 functions from
main
that are not strictly getters but removing theget
prefix makes them read better.