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:
@@ -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...))
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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(""),
|
||||
|
||||
Reference in New Issue
Block a user