diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index ca9e32e..06d38c7 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -20,7 +20,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.18 + go-version: 1.23 - name: Test run: go test -v ./... diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index e0e863e..69fd1b1 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -15,4 +15,4 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: - version: v1.56.2 + version: v1.61 diff --git a/go.mod b/go.mod index 778016a..fcd703b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/NETWAYS/support-collector -go 1.20 +go 1.22 require ( github.com/Showmax/go-fqdn v1.0.0 diff --git a/internal/util/util.go b/internal/util/util.go index df2beb1..73136c4 100644 --- a/internal/util/util.go +++ b/internal/util/util.go @@ -20,9 +20,10 @@ func StringInSlice(a string, list []string) bool { return false } -// DistinctStringSlice retuns the given slice with unique values +// DistinctStringSlice returns the given slice with unique values func DistinctStringSlice(arr []string) []string { seen := make(map[string]bool) + var result []string for _, val := range arr { diff --git a/modules/base/kernel.go b/modules/base/kernel.go index b3fe13b..86644df 100644 --- a/modules/base/kernel.go +++ b/modules/base/kernel.go @@ -54,7 +54,7 @@ func CharsToString(chars []int8) string { break } - s[i] = uint8(chars[i]) + s[i] = byte(chars[i]) } return string(s[0:i]) diff --git a/modules/icinga2/api.go b/modules/icinga2/api.go index 98874f6..7a4d2ba 100644 --- a/modules/icinga2/api.go +++ b/modules/icinga2/api.go @@ -60,7 +60,7 @@ func InitAPICollection(c *collection.Collection) error { // endpointIsReachable checks if the given endpoint is reachable within 5 sec func endpointIsReachable(endpoint string) error { - timeout := 5 * time.Second + timeout := 5 * time.Second //nolint:mnd // try to dial tcp connection within 5 seconds conn, err := net.DialTimeout("tcp", endpoint, timeout) @@ -84,7 +84,7 @@ func collectStatus(endpoint string, c *collection.Collection) error { client := &http.Client{Transport: tr} // build context for request - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) //nolint:mnd defer cancel() // build request