Skip to content

Commit a317541

Browse files
committed
chore: bump go version to 1.23
1 parent fe5bdac commit a317541

8 files changed

Lines changed: 21 additions & 18 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Set up Go 1.x
1515
uses: actions/setup-go@v5
1616
with:
17-
go-version: ~1.21
17+
go-version: ~1.23
1818
id: go
1919
- name: Check out code into the Go module directory
2020
uses: actions/checkout@v4
@@ -28,8 +28,8 @@ jobs:
2828
- uses: actions/checkout@v4
2929
- uses: actions/setup-go@v5
3030
with:
31-
go-version: ~1.21
31+
go-version: ~1.23
3232
- name: golangci-lint
3333
uses: golangci/golangci-lint-action@v6
3434
with:
35-
version: v1.56.2
35+
version: v1.64.8

.github/workflows/tags.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Install Go
1414
uses: actions/setup-go@v5
1515
with:
16-
go-version: ~1.21
16+
go-version: ~1.23
1717

1818
- name: Create release
1919
id: goreleaser

.golangci.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ linters:
66
enable:
77
- asciicheck
88
- bodyclose
9+
- copyloopvar
910
# - deadcode
1011
# - depguard
1112
- dogsled
1213
# - dupl # some commands are looks very similar in implementation
14+
- err113
1315
- errcheck
1416
- errorlint
1517
- exhaustive
1618
# - exhaustivestruct
17-
- exportloopref
19+
# - exportloopref
1820
- funlen
1921
- gci
2022
- gochecknoglobals
@@ -25,13 +27,11 @@ linters:
2527
- gocyclo
2628
- godot
2729
# - godox
28-
- goerr113
2930
- gofmt
3031
- gofumpt
3132
- goheader
3233
- goimports
3334
# - golint
34-
- gomnd
3535
- gomodguard
3636
- goprintffuncname
3737
- gosec
@@ -42,6 +42,7 @@ linters:
4242
- lll
4343
# - maligned
4444
- misspell
45+
- mnd
4546
- nakedret
4647
- nestif
4748
# - nlreturn
@@ -70,7 +71,10 @@ linters-settings:
7071
lll:
7172
line-length: 110
7273
gci:
73-
local-prefixes: github.com/enapter/enapter-cli
74+
sections:
75+
- standard
76+
- default
77+
- prefix(github.com/enapter/enapter-cli/)
7478

7579
issues:
7680
exclude-rules:

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module github.com/enapter/enapter-cli
22

3-
go 1.21
3+
go 1.23.0
4+
45

56
require (
67
github.com/gorilla/websocket v1.5.3

internal/app/enaptercli/cmd_device_assign_blueprint.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ func (c *cmdDevicesAssignBlueprint) Before(cliCtx *cli.Context) error {
5656
return err
5757
}
5858
if c.blueprintID != "" && c.blueprintPath != "" {
59-
return fmt.Errorf("only one of --blueprint-id or --blueprint-path can be specified")
59+
return errOnlyOneBlueprinFlag
6060
}
6161
if c.blueprintID == "" && c.blueprintPath == "" {
62-
return fmt.Errorf("one of --blueprint-id or --blueprint-path must be specified")
62+
return errMissedBlueprintFlag
6363
}
6464
return c.validateExpandFlag(cliCtx)
6565
}

internal/app/enaptercli/cmd_provisioning_lua_device.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ func (c *cmdProvisioningLua) Before(cliCtx *cli.Context) error {
6868
return err
6969
}
7070
if c.blueprintID != "" && c.blueprintPath != "" {
71-
return fmt.Errorf("only one of --blueprint-id or --blueprint-path can be specified")
71+
return errOnlyOneBlueprinFlag
7272
}
7373
if c.blueprintID == "" && c.blueprintPath == "" {
74-
return fmt.Errorf("one of --blueprint-id or --blueprint-path must be specified")
74+
return errMissedBlueprintFlag
7575
}
7676
return nil
7777
}

internal/app/enaptercli/errors.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ var (
66
errAPITokenMissed = errors.New("API token missing. Set it up using environment " +
77
"variable ENAPTER3_API_TOKEN")
88
errUnsupportedFlagValue = errors.New("unsupported flag value")
9+
errOnlyOneBlueprinFlag = errors.New("only one of --blueprint-id or --blueprint-path can be specified")
10+
errMissedBlueprintFlag = errors.New("one of --blueprint-id or --blueprint-path must be specified")
911
)

internal/app/enaptercli/execute_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ func TestHelpMessages(t *testing.T) {
2323
require.NoError(t, err)
2424

2525
for _, fi := range files {
26-
fi := fi
2726
t.Run(fi.Name(), func(t *testing.T) {
2827
args := strings.Split(fi.Name(), " ")
2928
args = append(args, "-h")
@@ -54,7 +53,6 @@ func TestHTTPReqResp(t *testing.T) {
5453
require.NoError(t, err)
5554

5655
for _, tc := range tests {
57-
tc := tc
5856
t.Run(tc.Name(), func(t *testing.T) {
5957
reqCount := 0
6058
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@@ -84,9 +82,7 @@ func TestHTTPReqResp(t *testing.T) {
8482
}))
8583
defer srv.Close()
8684

87-
tmplParams := struct {
88-
BaseFlags string
89-
}{
85+
tmplParams := struct{ BaseFlags string }{
9086
BaseFlags: strings.Join([]string{"--token", testToken, "--api-host", srv.URL}, " "),
9187
}
9288

0 commit comments

Comments
 (0)