update linters for go1.25 base version
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
@@ -140,11 +140,11 @@ func getFieldTags(ty reflect.Type) *fieldTags {
|
||||
continue
|
||||
}
|
||||
|
||||
comma := strings.Index(tag, ",")
|
||||
before, after, ok := strings.Cut(tag, ",")
|
||||
var name, kind string
|
||||
if comma != -1 {
|
||||
name = tag[:comma]
|
||||
kind = tag[comma+1:]
|
||||
if ok {
|
||||
name = before
|
||||
kind = after
|
||||
} else {
|
||||
name = tag
|
||||
kind = "attr"
|
||||
|
||||
@@ -9,11 +9,8 @@ import (
|
||||
"github.com/hashicorp/hcl/v2"
|
||||
)
|
||||
|
||||
var victimExpr hcl.Expression
|
||||
var victimBody hcl.Body
|
||||
|
||||
var exprType = reflect.TypeOf(&victimExpr).Elem()
|
||||
var bodyType = reflect.TypeOf(&victimBody).Elem()
|
||||
var blockType = reflect.TypeOf((*hcl.Block)(nil)) //nolint:unused
|
||||
var attrType = reflect.TypeOf((*hcl.Attribute)(nil))
|
||||
var attrsType = reflect.TypeOf(hcl.Attributes(nil))
|
||||
var exprType = reflect.TypeFor[hcl.Expression]()
|
||||
var bodyType = reflect.TypeFor[hcl.Body]()
|
||||
var blockType = reflect.TypeFor[*hcl.Block]() //nolint:unused
|
||||
var attrType = reflect.TypeFor[*hcl.Attribute]()
|
||||
var attrsType = reflect.TypeFor[hcl.Attributes]()
|
||||
|
||||
@@ -34,7 +34,6 @@ func TestIndexOf(t *testing.T) {
|
||||
}
|
||||
|
||||
for name, test := range tests {
|
||||
name, test := name, test
|
||||
t.Run(name, func(t *testing.T) {
|
||||
got, err := indexOfFunc().Call([]cty.Value{test.input, test.key})
|
||||
if test.wantErr {
|
||||
@@ -85,7 +84,6 @@ func TestBasename(t *testing.T) {
|
||||
}
|
||||
|
||||
for name, test := range tests {
|
||||
name, test := name, test
|
||||
t.Run(name, func(t *testing.T) {
|
||||
got, err := basenameFunc().Call([]cty.Value{test.input})
|
||||
if test.wantErr {
|
||||
@@ -136,7 +134,6 @@ func TestDirname(t *testing.T) {
|
||||
}
|
||||
|
||||
for name, test := range tests {
|
||||
name, test := name, test
|
||||
t.Run(name, func(t *testing.T) {
|
||||
got, err := dirnameFunc().Call([]cty.Value{test.input})
|
||||
if test.wantErr {
|
||||
@@ -190,7 +187,6 @@ func TestSanitize(t *testing.T) {
|
||||
}
|
||||
|
||||
for name, test := range tests {
|
||||
name, test := name, test
|
||||
t.Run(name, func(t *testing.T) {
|
||||
got, err := sanitizeFunc().Call([]cty.Value{test.input})
|
||||
require.NoError(t, err)
|
||||
@@ -251,7 +247,6 @@ func TestSemverCmp(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for name, test := range tests {
|
||||
name, test := name, test
|
||||
t.Run(name, func(t *testing.T) {
|
||||
got, err := semvercmpFunc().Call([]cty.Value{test.version, test.constraint})
|
||||
if test.wantErr {
|
||||
|
||||
@@ -133,8 +133,8 @@ func impliedStructType(rt reflect.Type, path cty.Path) (cty.Type, error) {
|
||||
}
|
||||
|
||||
var (
|
||||
valueType = reflect.TypeOf(cty.Value{})
|
||||
stringType = reflect.TypeOf("")
|
||||
valueType = reflect.TypeFor[cty.Value]()
|
||||
stringType = reflect.TypeFor[string]()
|
||||
)
|
||||
|
||||
// structTagIndices interrogates the fields of the given type (which must
|
||||
|
||||
Reference in New Issue
Block a user