lint: apply x/tools/modernize fixes

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi
2025-03-07 15:00:35 -08:00
parent e19c729d3e
commit d5d3d3d502
50 changed files with 238 additions and 266 deletions

View File

@@ -90,7 +90,7 @@ func (a *Attest) ToPB() *controllerapi.Attest {
}
func (a *Attest) MarshalJSON() ([]byte, error) {
m := make(map[string]interface{}, len(a.Attrs)+2)
m := make(map[string]any, len(a.Attrs)+2)
for k, v := range a.Attrs {
m[k] = v
}
@@ -102,7 +102,7 @@ func (a *Attest) MarshalJSON() ([]byte, error) {
}
func (a *Attest) UnmarshalJSON(data []byte) error {
var m map[string]interface{}
var m map[string]any
if err := json.Unmarshal(data, &m); err != nil {
return err
}

View File

@@ -150,7 +150,7 @@ func (e *CacheOptionsEntry) UnmarshalText(text []byte) error {
return e.validate(text)
}
func (e *CacheOptionsEntry) validate(gv interface{}) error {
func (e *CacheOptionsEntry) validate(gv any) error {
if e.Type == "" {
var text []byte
switch gv := gv.(type) {

View File

@@ -33,7 +33,7 @@ func removeDupes[E comparable[E]](s []E) []E {
return s
}
func getAndDelete(m map[string]cty.Value, attr string, gv interface{}) error {
func getAndDelete(m map[string]cty.Value, attr string, gv any) error {
if v, ok := m[attr]; ok && v.IsKnown() {
delete(m, attr)
return gocty.FromCtyValue(v, gv)