1
0
mirror of https://github.com/coreos/prometheus-operator.git synced 2026-02-05 06:45:27 +01:00

feat: Apply modernize analyzer to the codebase (#7854)

Signed-off-by: Hélia Barroso <helia_barroso@hotmail.com>
This commit is contained in:
Hélia Barroso
2025-09-01 10:33:41 +01:00
committed by GitHub
parent eb2e1d01c9
commit cacffa596c
55 changed files with 193 additions and 396 deletions

View File

@@ -23,7 +23,7 @@ import (
)
func SetMaxProcs(logger *slog.Logger) {
l := func(format string, a ...interface{}) {
l := func(format string, a ...any) {
logger.Info(fmt.Sprintf(strings.TrimPrefix(format, "maxprocs: "), a...))
}

View File

@@ -38,7 +38,7 @@ func TestReplaceAttributes(t *testing.T) {
l.Info("test")
var m map[string]interface{}
var m map[string]any
err := json.Unmarshal(buf.Bytes(), &m)
require.NoError(t, err)

View File

@@ -29,7 +29,7 @@ func TestSortKeysEmptyMap(t *testing.T) {
func TestSortKeys(t *testing.T) {
intKeys := SortedKeys(map[int]interface{}{
intKeys := SortedKeys(map[int]any{
-10: 6,
0: "",
5: []byte(""),
@@ -37,7 +37,7 @@ func TestSortKeys(t *testing.T) {
})
require.Equal(t, []int{-10, -1, 0, 5}, intKeys)
strKeys := SortedKeys(map[string]interface{}{
strKeys := SortedKeys(map[string]any{
"a": 6,
"c": "",
"d": []byte(""),
@@ -45,7 +45,7 @@ func TestSortKeys(t *testing.T) {
})
require.Equal(t, []string{"a", "b", "c", "d"}, strKeys)
int32Keys := SortedKeys(map[int32]interface{}{
int32Keys := SortedKeys(map[int32]any{
-10: 6,
0: "",
5: []byte(""),