Skip to content

Commit c74baeb

Browse files
committed
change minimal supported golang 1.24
and update dependencies
1 parent 4c9b432 commit c74baeb

33 files changed

Lines changed: 254 additions & 233 deletions

.golangci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ linters:
4141
disable:
4242
- cyclop
4343
- depguard
44-
- exhaustruct
4544
- err113
45+
- exhaustruct
4646
- gochecknoglobals
4747
- gochecknoinits
4848
- gofumpt
@@ -51,6 +51,7 @@ linters:
5151
- perfsprint
5252
- tagliatelle
5353
- testpackage
54+
- wrapcheck
5455
- wsl
5556
# deprecated
5657
- tenv

Changes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ This file documents the revision history for the Livestatus Multitool Daemon (LM
55
next:
66
- improve filter performance
77
- fix accessing contacts.groups column when using icinga2
8+
- minimal supported golang 1.24
89

910
2.6.2 Fri Jul 25 11:53:14 CEST 2025
1011
- make sure thread dumps can always be logged

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ GOVERSION:=$(shell \
77
go version | \
88
awk -F'go| ' '{ split($$5, a, /\./); printf ("%04d%04d", a[1], a[2]); exit; }' \
99
)
10-
# also update README.md and .github/workflows/citest.yml when changing minumum version
10+
# also update README.md and .github/workflows/citest.yml when changing minimum version
1111
# find . -name go.mod
12-
MINGOVERSION:=00010023
13-
MINGOVERSIONSTR:=1.23
12+
MINGOVERSION:=00010024
13+
MINGOVERSIONSTR:=1.24
1414
BUILD:=$(shell git rev-parse --short HEAD)
1515
# see https://github.com/go-modules-by-example/index/blob/master/010_tools/README.md
1616
# and https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Log table requests and commands are just passed through to the actual backends.
2424

2525
You will need
2626

27-
- Go >= 1.23
27+
- Golang >= 1.24
2828

2929
to compile lmd.
3030

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.23
3+
go 1.24
44

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

go.mod

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module github.com/sni/lmd/v2
22

3-
go 1.23.0
3+
go 1.24.0
44

5-
toolchain go1.23.6
5+
toolchain go1.24.7
66

77
replace pkg/lmd => ./pkg/lmd
88

@@ -24,14 +24,15 @@ require (
2424
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
2525
github.com/modern-go/reflect2 v1.0.2 // indirect
2626
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
27-
github.com/petermattis/goid v0.0.0-20250721140440-ea1c0173183e // indirect
28-
github.com/prometheus/client_golang v1.22.0 // indirect
27+
github.com/petermattis/goid v0.0.0-20250904145737-900bdf8bb490 // indirect
28+
github.com/prometheus/client_golang v1.23.2 // indirect
2929
github.com/prometheus/client_model v0.6.2 // indirect
30-
github.com/prometheus/common v0.65.0 // indirect
30+
github.com/prometheus/common v0.66.1 // indirect
3131
github.com/prometheus/procfs v0.17.0 // indirect
32-
github.com/sasha-s/go-deadlock v0.3.5 // indirect
32+
github.com/sasha-s/go-deadlock v0.3.6 // indirect
3333
github.com/willabides/rjson v0.2.0 // indirect
34-
golang.org/x/sync v0.16.0 // indirect
35-
golang.org/x/sys v0.34.0 // indirect
36-
google.golang.org/protobuf v1.36.6 // indirect
34+
go.yaml.in/yaml/v2 v2.4.3 // indirect
35+
golang.org/x/sync v0.17.0 // indirect
36+
golang.org/x/sys v0.36.0 // indirect
37+
google.golang.org/protobuf v1.36.9 // indirect
3738
)

go.sum

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ github.com/kdar/factorlog v0.0.0-20211012144011-6ea75a169038 h1:ah2n2FwhELUb5o+K
2222
github.com/kdar/factorlog v0.0.0-20211012144011-6ea75a169038/go.mod h1:vLeQHWaOMUQZ1ytnCskhwI5fCcXA7xxK0QjCngYPqbo=
2323
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
2424
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
25+
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
26+
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
27+
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
28+
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
2529
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
2630
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
2731
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
@@ -37,38 +41,44 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
3741
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
3842
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
3943
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
40-
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4=
41-
github.com/petermattis/goid v0.0.0-20250721140440-ea1c0173183e h1:D0bJD+4O3G4izvrQUmzCL80zazlN7EwJ0PPDhpJWC/I=
42-
github.com/petermattis/goid v0.0.0-20250721140440-ea1c0173183e/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4=
44+
github.com/petermattis/goid v0.0.0-20250813065127-a731cc31b4fe/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4=
45+
github.com/petermattis/goid v0.0.0-20250904145737-900bdf8bb490 h1:QTvNkZ5ylY0PGgA+Lih+GdboMLY/G9SEGLMEGVjTVA4=
46+
github.com/petermattis/goid v0.0.0-20250904145737-900bdf8bb490/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4=
4347
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
4448
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
45-
github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q=
46-
github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0=
49+
github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
50+
github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=
4751
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
4852
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
49-
github.com/prometheus/common v0.65.0 h1:QDwzd+G1twt//Kwj/Ww6E9FQq1iVMmODnILtW1t2VzE=
50-
github.com/prometheus/common v0.65.0/go.mod h1:0gZns+BLRQ3V6NdaerOhMbwwRbNh9hkGINtQAsP5GS8=
53+
github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9ZoGs=
54+
github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA=
5155
github.com/prometheus/procfs v0.17.0 h1:FuLQ+05u4ZI+SS/w9+BWEM2TXiHKsUQ9TADiRH7DuK0=
5256
github.com/prometheus/procfs v0.17.0/go.mod h1:oPQLaDAMRbA+u8H5Pbfq+dl3VDAvHxMUOVhe0wYB2zw=
53-
github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU=
54-
github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U=
57+
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
58+
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
59+
github.com/sasha-s/go-deadlock v0.3.6 h1:TR7sfOnZ7x00tWPfD397Peodt57KzMDo+9Ae9rMiUmw=
60+
github.com/sasha-s/go-deadlock v0.3.6/go.mod h1:CUqNyyvMxTyjFqDT7MRg9mb4Dv/btmGTqSR+rky/UXo=
5561
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
5662
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
5763
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
58-
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
59-
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
64+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
65+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
6066
github.com/willabides/rjson v0.2.0 h1:cgBIzis7l9ugUTtaLMcl12pJBu1m62oTBGf/XXBHhJI=
6167
github.com/willabides/rjson v0.2.0/go.mod h1:9fWQED96t+VlaF7GPwf/qRHLdNbAjjBkaPxmmjyuW5E=
6268
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
6369
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
64-
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
65-
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
70+
go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0=
71+
go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8=
72+
golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
73+
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
6674
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
67-
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
68-
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
69-
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
70-
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
75+
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
76+
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
77+
google.golang.org/protobuf v1.36.9 h1:w2gp2mA27hUeUzj9Ex9FBjsBm40zfaDtEWow293U7Iw=
78+
google.golang.org/protobuf v1.36.9/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
7179
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
80+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
81+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
7282
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
7383
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
7484
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

pkg/lmd/a_helper_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ func StartTestPeerExtra(numPeers, numHosts, numServices int, extraConfig string)
394394
err = fmt.Errorf("timeout while waiting for mock listenern to stop")
395395
}
396396

397-
return
397+
return err
398398
}
399399

400400
return peer, cleanup, mocklmd
@@ -503,7 +503,7 @@ func GetHTTPMockServerPeer(t *testing.T, lmd *Daemon) (peer *Peer, cleanup func(
503503
ts, cleanup := StartHTTPMockServer(t, lmd)
504504
peer = NewPeer(lmd, &Connection{Source: []string{ts.URL}, Name: "TestPeer", ID: "testid"})
505505

506-
return
506+
return peer, cleanup
507507
}
508508

509509
func convertTestDataMapToList(filename string, columns []string) []byte {
@@ -587,7 +587,7 @@ func getTestDataColumns(dataFolder string) (columns [][]string) {
587587
}
588588
}
589589

590-
return
590+
return columns
591591
}
592592

593593
func getTestLogStats(req *Request) []byte {
@@ -673,7 +673,7 @@ func TestMock1(t *testing.T) {
673673
Name: "TestPeer",
674674
})
675675

676-
err := peer.InitAllTables(context.TODO())
676+
err := peer.InitAllTables(t.Context())
677677
require.NoErrorf(t, err, "init tables failed")
678678

679679
// tear down

pkg/lmd/benchmark_test.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package lmd
33
import (
44
"bufio"
55
"bytes"
6-
"context"
76
"fmt"
87
"strings"
98
"testing"
@@ -25,13 +24,13 @@ func BenchmarkParseResultJSON(b *testing.B) {
2524
columns = append(columns, col.Name)
2625
}
2726
}
28-
req, _, err := NewRequest(context.TODO(), peer.lmd, bufio.NewReader(bytes.NewBufferString(fmt.Sprintf("GET services\nOutputFormat: json\nColumns: %s\nColumnHeaders: on\n", strings.Join(columns, " ")))), ParseOptimize)
27+
req, _, err := NewRequest(b.Context(), peer.lmd, bufio.NewReader(bytes.NewBufferString(fmt.Sprintf("GET services\nOutputFormat: json\nColumns: %s\nColumnHeaders: on\n", strings.Join(columns, " ")))), ParseOptimize)
2928
require.NoError(b, err)
3029

3130
conn, connType, err := peer.GetConnection(req)
3231
require.NoError(b, err)
3332

34-
resBytes, _, err := peer.getQueryResponse(context.TODO(), req, req.String(), peer.peerAddr.Get(), conn, connType)
33+
resBytes, _, err := peer.getQueryResponse(b.Context(), req, req.String(), peer.peerAddr.Get(), conn, connType)
3534
require.NoError(b, err)
3635

3736
b.StartTimer()
@@ -67,13 +66,13 @@ func BenchmarkParseResultWrappedJSON(b *testing.B) {
6766
columns = append(columns, col.Name)
6867
}
6968
}
70-
req, _, err := NewRequest(context.TODO(), peer.lmd, bufio.NewReader(bytes.NewBufferString(fmt.Sprintf("GET services\nOutputFormat: wrapped_json\nColumns: %s\nColumnHeaders: on\n", strings.Join(columns, " ")))), ParseOptimize)
69+
req, _, err := NewRequest(b.Context(), peer.lmd, bufio.NewReader(bytes.NewBufferString(fmt.Sprintf("GET services\nOutputFormat: wrapped_json\nColumns: %s\nColumnHeaders: on\n", strings.Join(columns, " ")))), ParseOptimize)
7170
require.NoError(b, err)
7271

7372
conn, connType, err := peer.GetConnection(req)
7473
require.NoError(b, err)
7574

76-
resBytes, _, err := peer.getQueryResponse(context.TODO(), req, req.String(), peer.peerAddr.Get(), conn, connType)
75+
resBytes, _, err := peer.getQueryResponse(b.Context(), req, req.String(), peer.peerAddr.Get(), conn, connType)
7776
require.NoError(b, err)
7877

7978
b.StartTimer()
@@ -100,11 +99,10 @@ func BenchmarkPeerUpdate(b *testing.B) {
10099
peer, cleanup, _ := StartTestPeer(1, 1000, 10000)
101100
PauseTestPeers(peer)
102101

103-
ctx := context.TODO()
104102
b.StartTimer()
105103
data := peer.data.Load()
106104
for range b.N {
107-
err := data.UpdateFull(ctx, Objects.UpdateTables)
105+
err := data.UpdateFull(b.Context(), Objects.UpdateTables)
108106
if err != nil {
109107
panic("Update failed")
110108
}
@@ -129,7 +127,7 @@ func BenchmarkPeerUpdateServiceInsert(b *testing.B) {
129127
OutputFormat: OutputFormatJSON,
130128
FilterStr: "Filter: host_name !=\n",
131129
}
132-
res, meta, err := peer.Query(context.TODO(), req)
130+
res, meta, err := peer.Query(b.Context(), req)
133131
if err != nil {
134132
return
135133
}
@@ -335,7 +333,7 @@ func BenchmarkRequestParser1(b *testing.B) {
335333
lmd := createTestLMDInstance()
336334
for range b.N {
337335
buf := bufio.NewReader(bytes.NewBufferString(servicesPageQuery))
338-
_, size, err := NewRequest(context.TODO(), lmd, buf, ParseOptimize)
336+
_, size, err := NewRequest(b.Context(), lmd, buf, ParseOptimize)
339337
if err != nil {
340338
panic(err.Error())
341339
}
@@ -349,7 +347,7 @@ func BenchmarkRequestParser2(b *testing.B) {
349347
lmd := createTestLMDInstance()
350348
for range b.N {
351349
buf := bufio.NewReader(bytes.NewBufferString(tacPageStatsQuery))
352-
_, size, err := NewRequest(context.TODO(), lmd, buf, ParseOptimize)
350+
_, size, err := NewRequest(b.Context(), lmd, buf, ParseOptimize)
353351
if err != nil {
354352
panic(err.Error())
355353
}

pkg/lmd/client_con.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,27 +221,27 @@ func (cl *ClientConnection) processRequest(ctx context.Context, req *Request) (s
221221
if errors.As(err, &netErr) {
222222
LogErrors((&Response{code: ReturnCodeConnectionError, request: req, err: netErr}).Send(cl))
223223

224-
return
224+
return size, err
225225
}
226226

227227
var peerErr *PeerError
228228
if errors.As(err, &peerErr) && peerErr.kind == ConnectionError {
229229
LogErrors((&Response{code: ReturnCodeConnectionError, request: req, err: peerErr}).Send(cl))
230230

231-
return
231+
return size, err
232232
}
233233
LogErrors((&Response{code: ReturnCodeBadRequest, request: req, err: err}).Send(cl))
234234

235-
return
235+
return size, err
236236
}
237237

238-
return
238+
return size, err
239239
}
240240

241241
// sendRemainingCommands sends all queued commands.
242242
func (cl *ClientConnection) sendRemainingCommands(ctx context.Context, commandsByPeer *map[string][]string) (err error) {
243243
if len(*commandsByPeer) == 0 {
244-
return
244+
return err
245245
}
246246
time1 := time.Now()
247247
code, msg := cl.SendCommands(ctx, *commandsByPeer)
@@ -250,11 +250,11 @@ func (cl *ClientConnection) sendRemainingCommands(ctx context.Context, commandsB
250250
if code != ReturnCodeOK {
251251
_, err = fmt.Fprintf(cl.connection, "%d: %s\n", code, msg)
252252

253-
return
253+
return err
254254
}
255255
logWith(ctx).Infof("incoming command request finished in %s", time.Since(time1))
256256

257-
return
257+
return err
258258
}
259259

260260
// SendCommands sends commands for this request to all selected remote sites.

0 commit comments

Comments
 (0)