Skip to content

Commit 19c4119

Browse files
committed
change minimum golang requirement to 1.23
1 parent 8f08724 commit 19c4119

File tree

9 files changed

+18
-17
lines changed

9 files changed

+18
-17
lines changed

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ linters:
5151
- testpackage
5252
- wsl
5353
# deprecated
54-
- exportloopref
54+
- tenv
5555
issues:
5656
max-same-issues: 0
5757
max-issues-per-linter: 0

Changes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ next:
44
- fix check_files thresholds on total_size
55
- update windows exporter to 0.30.2
66
- chore: update dependencies
7+
- change minimum golang requirement to 1.23
78

89
0.30 Wed Jan 15 12:08:28 CET 2025
910
- fix check_drivesize letter: excludes

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ GOVERSION:=$(shell \
99
)
1010
# also update docs/install/build.md and .github/workflows/builds.yml when changing minimum version
1111
# find . -name go.mod (run make gomods afterwards)
12-
MINGOVERSION:=00010022
13-
MINGOVERSIONSTR:=1.22
12+
MINGOVERSION:=00010023
13+
MINGOVERSIONSTR:=1.23
1414
BUILD:=$(shell git rev-parse --short HEAD)
1515
REVISION:=$(shell ./buildtools/get_version | awk -F . '{ print $$3 }')
1616
# see https://github.com/go-modules-by-example/index/blob/master/010_tools/README.md

buildtools/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module tools
22

3-
go 1.22.0
3+
go 1.23.0
44

55
require (
66
github.com/daixiang0/gci v0.12.3

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/consol-monitoring/snclient
22

3-
go 1.22.0
3+
go 1.23.6
44

55
require (
66
github.com/beevik/ntp v1.4.3
@@ -14,7 +14,7 @@ require (
1414
github.com/miekg/dns v1.1.63
1515
github.com/otiai10/copy v1.14.1
1616
github.com/prometheus/client_golang v1.20.5
17-
github.com/reeflective/readline v1.0.15
17+
github.com/reeflective/readline v1.1.2
1818
github.com/sasha-s/go-deadlock v0.3.5
1919
github.com/sassoftware/go-rpmutils v0.4.0
2020
github.com/sevlyar/go-daemon v0.1.6
@@ -49,7 +49,7 @@ require (
4949
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
5050
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
5151
github.com/otiai10/mint v1.6.3 // indirect
52-
github.com/petermattis/goid v0.0.0-20250121172306-05bcfb9a85dc // indirect
52+
github.com/petermattis/goid v0.0.0-20250211185408-f2b9d978cd7a // indirect
5353
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
5454
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
5555
github.com/prometheus/client_model v0.6.1 // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ github.com/otiai10/copy v1.14.1/go.mod h1:oQwrEDDOci3IM8dJF0d8+jnbfPDllW6vUjNc3D
6161
github.com/otiai10/mint v1.6.3 h1:87qsV/aw1F5as1eH1zS/yqHY85ANKVMgkDrf9rcxbQs=
6262
github.com/otiai10/mint v1.6.3/go.mod h1:MJm72SBthJjz8qhefc4z1PYEieWmy8Bku7CjcAqyUSM=
6363
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4=
64-
github.com/petermattis/goid v0.0.0-20250121172306-05bcfb9a85dc h1:Xz/LkK9AJRY5QTkA1uE1faB8yeqRFjeKgwDtI13ogcY=
65-
github.com/petermattis/goid v0.0.0-20250121172306-05bcfb9a85dc/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4=
64+
github.com/petermattis/goid v0.0.0-20250211185408-f2b9d978cd7a h1:ckxP/kGzsxvxXo8jO6E/0QJ8MMmwI7IRj4Fys9QbAZA=
65+
github.com/petermattis/goid v0.0.0-20250211185408-f2b9d978cd7a/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4=
6666
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
6767
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
6868
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU=
@@ -75,8 +75,8 @@ github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ
7575
github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I=
7676
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
7777
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
78-
github.com/reeflective/readline v1.0.15 h1:uB/M1sAc2yZGO14Ujgr/imLwQXqGdOhDDWAEHF+MBaE=
79-
github.com/reeflective/readline v1.0.15/go.mod h1:3iOe/qyb2jEy0KqLrNlb/CojBVqxga9ACqz/VU22H6A=
78+
github.com/reeflective/readline v1.1.2 h1:XhnNwVg7gQhrxk2cJ3/taU7KKPXEc9bCzl5oHrSi7aI=
79+
github.com/reeflective/readline v1.1.2/go.mod h1:CwNkh9BmFBBCSO6mdDaNWb34rOqQsI9eYbxyqvOEazY=
8080
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
8181
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
8282
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=

pkg/snclient/snclient.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"fmt"
99
"io"
1010
"io/fs"
11+
"maps"
1112
"net/http"
1213
_ "net/http/pprof" //nolint:gosec // default muxer is not exposed by default
1314
"os"
@@ -31,7 +32,6 @@ import (
3132
deadlock "github.com/sasha-s/go-deadlock"
3233
daemon "github.com/sevlyar/go-daemon"
3334
"github.com/shirou/gopsutil/v4/host"
34-
"golang.org/x/exp/maps"
3535
)
3636

3737
const (
@@ -893,7 +893,7 @@ func (snc *Agent) restartWatcherCb(restartCb func()) {
893893
lastStat := map[string]*fs.FileInfo{}
894894
files := []string{}
895895
files = append(files, snc.runSet.files...)
896-
files = append(files, maps.Keys(snc.config.alreadyIncluded)...)
896+
files = slices.AppendSeq(files, maps.Keys(snc.config.alreadyIncluded))
897897
files = append(files, binFile)
898898
ticker := time.NewTicker(500 * time.Millisecond)
899899
defer ticker.Stop()

pkg/snclient/test_utils_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ func MockSystemUtilities(t *testing.T, utils map[string]string) (tmpPath string)
9090
newTmp := t.TempDir()
9191

9292
newPath := append([]string{newTmp}, pathElements...)
93-
err := os.Setenv("PATH", strings.Join(newPath, ":"))
94-
require.NoErrorf(t, err, "set env worked")
93+
t.Setenv("PATH", strings.Join(newPath, ":"))
9594
tmpPath = newTmp
9695
}
9796

pkg/utils/utils.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ import (
77
"encoding/hex"
88
"fmt"
99
"io"
10+
"maps"
1011
"math"
1112
"net/http"
1213
"os"
1314
"path/filepath"
1415
"regexp"
1516
"runtime"
17+
"slices"
1618
"sort"
1719
"strconv"
1820
"strings"
@@ -21,7 +23,6 @@ import (
2123

2224
"github.com/consol-monitoring/snclient/pkg/convert"
2325
"github.com/kdar/factorlog"
24-
"golang.org/x/exp/maps"
2526
)
2627

2728
var reMountPassword = regexp.MustCompile(`//.*:.*@`)
@@ -522,7 +523,7 @@ func SortRanked(list []string, ranks map[string]int) []string {
522523

523524
// returns string map keys in sorted order
524525
func SortedKeys[V interface{}](m map[string]V) []string {
525-
keys := maps.Keys(m)
526+
keys := slices.AppendSeq(make([]string, 0, len(m)), maps.Keys(m))
526527
sort.Strings(keys)
527528

528529
return keys

0 commit comments

Comments
 (0)