Skip to content

Commit

Permalink
change minimum golang requirement to 1.23
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Feb 12, 2025
1 parent 8f08724 commit 19c4119
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ linters:
- testpackage
- wsl
# deprecated
- exportloopref
- tenv
issues:
max-same-issues: 0
max-issues-per-linter: 0
Expand Down
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ next:
- fix check_files thresholds on total_size
- update windows exporter to 0.30.2
- chore: update dependencies
- change minimum golang requirement to 1.23

0.30 Wed Jan 15 12:08:28 CET 2025
- fix check_drivesize letter: excludes
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ GOVERSION:=$(shell \
)
# also update docs/install/build.md and .github/workflows/builds.yml when changing minimum version
# find . -name go.mod (run make gomods afterwards)
MINGOVERSION:=00010022
MINGOVERSIONSTR:=1.22
MINGOVERSION:=00010023
MINGOVERSIONSTR:=1.23
BUILD:=$(shell git rev-parse --short HEAD)
REVISION:=$(shell ./buildtools/get_version | awk -F . '{ print $$3 }')
# see https://github.com/go-modules-by-example/index/blob/master/010_tools/README.md
Expand Down
2 changes: 1 addition & 1 deletion buildtools/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module tools

go 1.22.0
go 1.23.0

require (
github.com/daixiang0/gci v0.12.3
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/consol-monitoring/snclient

go 1.22.0
go 1.23.6

require (
github.com/beevik/ntp v1.4.3
Expand All @@ -14,7 +14,7 @@ require (
github.com/miekg/dns v1.1.63
github.com/otiai10/copy v1.14.1
github.com/prometheus/client_golang v1.20.5
github.com/reeflective/readline v1.0.15
github.com/reeflective/readline v1.1.2
github.com/sasha-s/go-deadlock v0.3.5
github.com/sassoftware/go-rpmutils v0.4.0
github.com/sevlyar/go-daemon v0.1.6
Expand Down Expand Up @@ -49,7 +49,7 @@ require (
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/otiai10/mint v1.6.3 // indirect
github.com/petermattis/goid v0.0.0-20250121172306-05bcfb9a85dc // indirect
github.com/petermattis/goid v0.0.0-20250211185408-f2b9d978cd7a // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ github.com/otiai10/copy v1.14.1/go.mod h1:oQwrEDDOci3IM8dJF0d8+jnbfPDllW6vUjNc3D
github.com/otiai10/mint v1.6.3 h1:87qsV/aw1F5as1eH1zS/yqHY85ANKVMgkDrf9rcxbQs=
github.com/otiai10/mint v1.6.3/go.mod h1:MJm72SBthJjz8qhefc4z1PYEieWmy8Bku7CjcAqyUSM=
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4=
github.com/petermattis/goid v0.0.0-20250121172306-05bcfb9a85dc h1:Xz/LkK9AJRY5QTkA1uE1faB8yeqRFjeKgwDtI13ogcY=
github.com/petermattis/goid v0.0.0-20250121172306-05bcfb9a85dc/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4=
github.com/petermattis/goid v0.0.0-20250211185408-f2b9d978cd7a h1:ckxP/kGzsxvxXo8jO6E/0QJ8MMmwI7IRj4Fys9QbAZA=
github.com/petermattis/goid v0.0.0-20250211185408-f2b9d978cd7a/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU=
Expand All @@ -75,8 +75,8 @@ github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ
github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I=
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/reeflective/readline v1.0.15 h1:uB/M1sAc2yZGO14Ujgr/imLwQXqGdOhDDWAEHF+MBaE=
github.com/reeflective/readline v1.0.15/go.mod h1:3iOe/qyb2jEy0KqLrNlb/CojBVqxga9ACqz/VU22H6A=
github.com/reeflective/readline v1.1.2 h1:XhnNwVg7gQhrxk2cJ3/taU7KKPXEc9bCzl5oHrSi7aI=
github.com/reeflective/readline v1.1.2/go.mod h1:CwNkh9BmFBBCSO6mdDaNWb34rOqQsI9eYbxyqvOEazY=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
Expand Down
4 changes: 2 additions & 2 deletions pkg/snclient/snclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"io"
"io/fs"
"maps"
"net/http"
_ "net/http/pprof" //nolint:gosec // default muxer is not exposed by default
"os"
Expand All @@ -31,7 +32,6 @@ import (
deadlock "github.com/sasha-s/go-deadlock"
daemon "github.com/sevlyar/go-daemon"
"github.com/shirou/gopsutil/v4/host"
"golang.org/x/exp/maps"
)

const (
Expand Down Expand Up @@ -893,7 +893,7 @@ func (snc *Agent) restartWatcherCb(restartCb func()) {
lastStat := map[string]*fs.FileInfo{}
files := []string{}
files = append(files, snc.runSet.files...)
files = append(files, maps.Keys(snc.config.alreadyIncluded)...)
files = slices.AppendSeq(files, maps.Keys(snc.config.alreadyIncluded))
files = append(files, binFile)
ticker := time.NewTicker(500 * time.Millisecond)
defer ticker.Stop()
Expand Down
3 changes: 1 addition & 2 deletions pkg/snclient/test_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ func MockSystemUtilities(t *testing.T, utils map[string]string) (tmpPath string)
newTmp := t.TempDir()

newPath := append([]string{newTmp}, pathElements...)
err := os.Setenv("PATH", strings.Join(newPath, ":"))
require.NoErrorf(t, err, "set env worked")
t.Setenv("PATH", strings.Join(newPath, ":"))
tmpPath = newTmp
}

Expand Down
5 changes: 3 additions & 2 deletions pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ import (
"encoding/hex"
"fmt"
"io"
"maps"
"math"
"net/http"
"os"
"path/filepath"
"regexp"
"runtime"
"slices"
"sort"
"strconv"
"strings"
Expand All @@ -21,7 +23,6 @@ import (

"github.com/consol-monitoring/snclient/pkg/convert"
"github.com/kdar/factorlog"
"golang.org/x/exp/maps"
)

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

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

return keys
Expand Down

0 comments on commit 19c4119

Please sign in to comment.