Skip to content

Commit

Permalink
Bump Golang version and golanglint
Browse files Browse the repository at this point in the history
  • Loading branch information
martialblog authored and tbauriedel committed Nov 12, 2024
1 parent fb05437 commit ab33f35
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./...
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.2
version: v1.61
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion internal/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion modules/base/kernel.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
4 changes: 2 additions & 2 deletions modules/icinga2/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit ab33f35

Please sign in to comment.