Skip to content

Commit f076e29

Browse files
authored
Merge branch 'master' into fix/ds100
2 parents 47668c2 + 6b09b16 commit f076e29

10 files changed

Lines changed: 145 additions & 139 deletions

File tree

.github/workflows/build.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v6
1515

16-
- uses: actions/setup-go@v3
16+
- uses: actions/setup-go@v6
1717
with:
18-
go-version: ^1.18
18+
go-version-file: go.mod
1919
cache: true
2020
id: go
2121

@@ -35,11 +35,11 @@ jobs:
3535
runs-on: ubuntu-latest
3636

3737
steps:
38-
- uses: actions/checkout@v3
38+
- uses: actions/checkout@v6
3939

40-
- uses: actions/setup-go@v3
40+
- uses: actions/setup-go@v6
4141
with:
42-
go-version: ^1.18
42+
go-version-file: go.mod
4343
cache: true
4444
id: go
4545

@@ -54,15 +54,15 @@ jobs:
5454
runs-on: ubuntu-latest
5555

5656
steps:
57-
- uses: actions/checkout@v3
57+
- uses: actions/checkout@v6
5858

59-
- uses: actions/setup-go@v3
59+
- uses: actions/setup-go@v6
6060
with:
61-
go-version: ^1.18
61+
go-version-file: go.mod
6262
cache: true
6363
id: go
6464

6565
- name: Lint
66-
uses: golangci/golangci-lint-action@v3
66+
uses: golangci/golangci-lint-action@v9
6767
with:
6868
version: latest

.golangci.yml

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,35 @@
1-
issues:
2-
exclude:
3-
- "`sunspecModelID` is unused"
4-
- "`printModel` is unused"
5-
- "func `..sunSpec..sanitizeModels` is unused"
6-
- "func `..SunSpec..relevantModelIds` is unused"
1+
version: "2"
2+
linters:
3+
settings:
4+
staticcheck:
5+
dot-import-whitelist:
6+
- "github.com/volkszaehler/mbmd/meters"
7+
exclusions:
8+
generated: lax
9+
presets:
10+
- comments
11+
- common-false-positives
12+
- legacy
13+
- std-error-handling
14+
rules:
15+
- path: (.+)\.go$
16+
text: "`sunspecModelID` is unused"
17+
- path: (.+)\.go$
18+
text: "`printModel` is unused"
19+
- path: (.+)\.go$
20+
text: "func printModel is unused"
21+
- path: (.+)\.go$
22+
text: "func \\(\\*SunSpec\\).sanitizeModels is unused"
23+
- path: (.+)\.go$
24+
text: "func \\(\\*SunSpec\\).relevantModelIds is unused"
25+
paths:
26+
- third_party$
27+
- builtin$
28+
- examples$
29+
formatters:
30+
exclusions:
31+
generated: lax
32+
paths:
33+
- third_party$
34+
- builtin$
35+
- examples$

cmd/write.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,12 @@ func encodeCoil(value string, length int) (b []byte) {
103103
log.Fatal(err)
104104
}
105105

106-
if u == 0 {
106+
switch u {
107+
case 0:
107108
b = []byte{0, 0}
108-
} else if u == 1 || u == 0xFF00 {
109+
case 1, 0xFF00:
109110
b = []byte{0xFF, 0}
110-
} else {
111+
default:
111112
log.Fatal("Invalid value")
112113
}
113114

go.mod

Lines changed: 28 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,56 @@
11
module github.com/volkszaehler/mbmd
22

3-
go 1.21
4-
5-
toolchain go1.21.5
3+
go 1.24.0
64

75
require (
8-
github.com/andig/gosunspec v0.0.0-20231205122018-1daccfa17912
9-
github.com/dmarkham/enumer v1.5.9
10-
github.com/eclipse/paho.mqtt.golang v1.4.3
6+
github.com/andig/gosunspec v0.0.0-20240918203654-860ce51d602b
7+
github.com/dmarkham/enumer v1.6.1
8+
github.com/eclipse/paho.mqtt.golang v1.5.1
119
github.com/gorilla/handlers v1.5.2
1210
github.com/gorilla/mux v1.8.1
13-
github.com/gorilla/websocket v1.5.1
14-
github.com/grid-x/modbus v0.0.0-20240429072715-02314cc902aa
15-
github.com/influxdata/influxdb-client-go/v2 v2.13.0
16-
github.com/spf13/cobra v1.8.0
17-
github.com/spf13/pflag v1.0.5
18-
github.com/spf13/viper v1.18.2
19-
github.com/stretchr/testify v1.9.0
11+
github.com/gorilla/websocket v1.5.3
12+
github.com/grid-x/modbus v0.0.0-20251121133955-8a6c959be366
13+
github.com/influxdata/influxdb-client-go/v2 v2.14.0
14+
github.com/spf13/cobra v1.10.2
15+
github.com/spf13/pflag v1.0.10
16+
github.com/spf13/viper v1.21.0
17+
github.com/stretchr/testify v1.11.1
2018
github.com/tcnksm/go-latest v0.0.0-20170313132115-e3007ae9052e
21-
golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f
19+
golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93
2220
)
2321

2422
require (
2523
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
26-
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
24+
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
2725
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
2826
github.com/felixge/httpsnoop v1.0.4 // indirect
29-
github.com/fsnotify/fsnotify v1.7.0 // indirect
27+
github.com/fsnotify/fsnotify v1.9.0 // indirect
28+
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
3029
github.com/google/go-github v17.0.0+incompatible // indirect
3130
github.com/google/go-querystring v1.1.0 // indirect
3231
github.com/google/uuid v1.6.0 // indirect
3332
github.com/grid-x/serial v0.0.0-20211107191517-583c7356b3aa // indirect
34-
github.com/hashicorp/go-version v1.6.0 // indirect
35-
github.com/hashicorp/hcl v1.0.0 // indirect
33+
github.com/hashicorp/go-version v1.8.0 // indirect
3634
github.com/inconshreveable/mousetrap v1.1.0 // indirect
3735
github.com/influxdata/line-protocol v0.0.0-20210922203350-b1ad95c89adf // indirect
38-
github.com/magiconair/properties v1.8.7 // indirect
39-
github.com/mitchellh/mapstructure v1.5.0 // indirect
4036
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
41-
github.com/oapi-codegen/runtime v1.1.1 // indirect
37+
github.com/oapi-codegen/runtime v1.1.2 // indirect
4238
github.com/pascaldekloe/name v1.0.1 // indirect
43-
github.com/pelletier/go-toml/v2 v2.2.1 // indirect
39+
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
4440
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
4541
github.com/russross/blackfriday/v2 v2.1.0 // indirect
46-
github.com/sagikazarmark/locafero v0.4.0 // indirect
47-
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
48-
github.com/sourcegraph/conc v0.3.0 // indirect
49-
github.com/spf13/afero v1.11.0 // indirect
50-
github.com/spf13/cast v1.6.0 // indirect
42+
github.com/sagikazarmark/locafero v0.12.0 // indirect
43+
github.com/spf13/afero v1.15.0 // indirect
44+
github.com/spf13/cast v1.10.0 // indirect
5145
github.com/subosito/gotenv v1.6.0 // indirect
52-
go.uber.org/multierr v1.11.0 // indirect
53-
golang.org/x/mod v0.17.0 // indirect
54-
golang.org/x/net v0.24.0 // indirect
55-
golang.org/x/sync v0.7.0 // indirect
56-
golang.org/x/sys v0.19.0 // indirect
57-
golang.org/x/text v0.14.0 // indirect
58-
golang.org/x/tools v0.20.0 // indirect
46+
go.yaml.in/yaml/v3 v3.0.4 // indirect
47+
golang.org/x/mod v0.31.0 // indirect
48+
golang.org/x/net v0.48.0 // indirect
49+
golang.org/x/sync v0.19.0 // indirect
50+
golang.org/x/sys v0.39.0 // indirect
51+
golang.org/x/text v0.32.0 // indirect
52+
golang.org/x/tools v0.40.0 // indirect
5953
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect
60-
gopkg.in/ini.v1 v1.67.0 // indirect
6154
gopkg.in/yaml.v3 v3.0.1 // indirect
6255
)
6356

0 commit comments

Comments
 (0)