mirror of
https://github.com/mgechev/revive.git
synced 2025-11-23 22:04:49 +02:00
feature: add support for omitzero in rule struct-tag (#1238)
This commit is contained in:
@@ -38,6 +38,7 @@ var (
|
||||
go115 = goversion.Must(goversion.NewVersion("1.15"))
|
||||
go121 = goversion.Must(goversion.NewVersion("1.21"))
|
||||
go122 = goversion.Must(goversion.NewVersion("1.22"))
|
||||
go124 = goversion.Must(goversion.NewVersion("1.24"))
|
||||
)
|
||||
|
||||
// Files return package's files.
|
||||
@@ -210,6 +211,11 @@ func (p *Package) IsAtLeastGo122() bool {
|
||||
return p.goVersion.GreaterThanOrEqual(go122)
|
||||
}
|
||||
|
||||
// IsAtLeastGo124 returns true if the Go version for this package is 1.24 or higher, false otherwise
|
||||
func (p *Package) IsAtLeastGo124() bool {
|
||||
return p.goVersion.GreaterThanOrEqual(go124)
|
||||
}
|
||||
|
||||
func getSortableMethodFlagForFunction(fn *ast.FuncDecl) sortableMethodsFlags {
|
||||
switch {
|
||||
case astutils.FuncSignatureIs(fn, "Len", []string{}, []string{"int"}):
|
||||
|
||||
Reference in New Issue
Block a user