Skip to content

Commit 4bb9291

Browse files
authored
Merge pull request #107 from NETWAYS/chore/go1-23
Bump to Go 1.23
2 parents 07f1364 + 453152e commit 4bb9291

File tree

8 files changed

+17
-15
lines changed

8 files changed

+17
-15
lines changed

.github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up Go
2020
uses: actions/setup-go@v5
2121
with:
22-
go-version: 1.21
22+
go-version: 1.23
2323

2424
- name: Vet
2525
run: go vet ./...
@@ -35,6 +35,6 @@ jobs:
3535
uses: goreleaser/goreleaser-action@v6
3636
with:
3737
version: latest
38-
args: release --rm-dist
38+
args: release --clean
3939
env:
4040
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/golangci-lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ jobs:
1717
- name: golangci-lint
1818
uses: golangci/golangci-lint-action@v6
1919
with:
20-
version: v1.54
20+
version: v1.61

.golangci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ linters:
1919
- goerr113
2020
- gofumpt
2121
- gomnd
22+
- mnd
2223
- lll
2324
- musttag
2425
- nakedret

cmd/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package cmd
22

33
import (
4-
"fmt"
4+
"errors"
55
"net"
66
"net/http"
77
"net/url"
@@ -94,7 +94,7 @@ func (c *Config) NewClient() *client.Client {
9494
if c.BasicAuth != "" {
9595
s := strings.Split(c.BasicAuth, ":")
9696
if len(s) != 2 {
97-
check.ExitError(fmt.Errorf("specify the user name and password for server authentication <user:password>"))
97+
check.ExitError(errors.New("specify the user name and password for server authentication <user:password>"))
9898
}
9999

100100
var u = s[0]

cmd/health.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package cmd
22

33
import (
44
"encoding/json"
5+
"errors"
56
"fmt"
67
"net/http"
78
"net/url"
@@ -139,7 +140,7 @@ var healthCmd = &cobra.Command{
139140
\_[OK] Heap usage at 12.00%
140141
\_[OK] Open file descriptors at 12.00%
141142
\_[WARNING] CPU usage at 55.00%`,
142-
Run: func(cmd *cobra.Command, args []string) {
143+
Run: func(_ *cobra.Command, _ []string) {
143144
var (
144145
output string
145146
rc int
@@ -192,7 +193,7 @@ var healthCmd = &cobra.Command{
192193
// Logstash Health Status
193194
switch stat.Status {
194195
default:
195-
check.ExitError(fmt.Errorf("could not determine status"))
196+
check.ExitError(errors.New("could not determine status"))
196197
case "green":
197198
states = append(states, check.OK)
198199
case "yellow":

cmd/pipeline.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ var pipelineCmd = &cobra.Command{
7676
$ check_logstash pipeline --inflight-events-warn 5 --inflight-events-crit 10 --pipeline example
7777
CRITICAL - Inflight events
7878
\_[CRITICAL] inflight_events_example:15`,
79-
Run: func(cmd *cobra.Command, args []string) {
79+
Run: func(_ *cobra.Command, _ []string) {
8080
var (
8181
output string
8282
rc int
@@ -143,7 +143,7 @@ var pipelineCmd = &cobra.Command{
143143
Uom: "c",
144144
Value: pipe.Events.Out})
145145
perfList.Add(&perfdata.Perfdata{
146-
Label: fmt.Sprintf("inflight_events_%s", name),
146+
Label: fmt.Sprintf("inflight_events_%s", name), //nolint: perfsprint
147147
Warn: thresholds.Warning,
148148
Crit: thresholds.Critical,
149149
Value: inflightEvents})
@@ -187,7 +187,7 @@ var pipelineReloadCmd = &cobra.Command{
187187
$ check_logstash pipeline reload --pipeline Example
188188
CRITICAL - Configuration reload failed
189189
\_[CRITICAL] Configuration reload for pipeline Example failed on 2021-01-01T02:07:14Z`,
190-
Run: func(cmd *cobra.Command, args []string) {
190+
Run: func(_ *cobra.Command, _ []string) {
191191
var (
192192
output string
193193
rc int
@@ -278,7 +278,7 @@ var pipelineFlowCmd = &cobra.Command{
278278
$ check_logstash pipeline flow --pipeline example --warning 5 --critical 10
279279
CRITICAL - Flow metrics not alright
280280
\_[CRITICAL] queue_backpressure_example:11.23;`,
281-
Run: func(cmd *cobra.Command, args []string) {
281+
Run: func(_ *cobra.Command, _ []string) {
282282
var (
283283
output string
284284
rc int
@@ -335,7 +335,7 @@ var pipelineFlowCmd = &cobra.Command{
335335

336336
// Generate perfdata for each event
337337
perfList.Add(&perfdata.Perfdata{
338-
Label: fmt.Sprintf("pipelines.queue_backpressure_%s", name),
338+
Label: fmt.Sprintf("pipelines.queue_backpressure_%s", name), //nolint: perfsprint
339339
Warn: thresholds.Warning,
340340
Crit: thresholds.Critical,
341341
Value: pipe.Flow.QueueBackpressure.Current})

cmd/root.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var Timeout = 30
1212
var rootCmd = &cobra.Command{
1313
Use: "check_logstash",
1414
Short: "An Icinga check plugin to check Logstash",
15-
PersistentPreRun: func(cmd *cobra.Command, args []string) {
15+
PersistentPreRun: func(_ *cobra.Command, _ []string) {
1616
go check.HandleTimeout(Timeout)
1717
},
1818
Run: Usage,

internal/logstash/api.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package logstash
22

33
import (
44
"encoding/json"
5-
"fmt"
5+
"errors"
66
"strconv"
77
"strings"
88
)
@@ -95,7 +95,7 @@ func (s *Stat) UnmarshalJSON(b []byte) error {
9595
majorVersion, convErr := strconv.Atoi(v[0])
9696

9797
if convErr != nil {
98-
return fmt.Errorf("could not determine version")
98+
return errors.New("could not determine version")
9999
}
100100

101101
s.MajorVersion = majorVersion

0 commit comments

Comments
 (0)