Skip to content
This repository was archived by the owner on Aug 31, 2025. It is now read-only.

Commit 349d9a6

Browse files
authored
bump Golang to 1.23 (#210)
1 parent d449db0 commit 349d9a6

15 files changed

+58
-40
lines changed

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515

1616
- uses: actions/setup-go@v3
1717
with:
18-
go-version: "1.22"
18+
go-version: "1.23"
1919

2020
- uses: golangci/golangci-lint-action@v3
2121
with:
22-
version: v1.59.1
22+
version: v1.61.0
2323

2424
go-mod-tidy:
2525
runs-on: ubuntu-22.04
@@ -29,7 +29,7 @@ jobs:
2929

3030
- uses: actions/setup-go@v3
3131
with:
32-
go-version: "1.22"
32+
go-version: "1.23"
3333

3434
- run: |
3535
go mod tidy

.github/workflows/msgs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
steps:
1313
- uses: actions/setup-go@v3
1414
with:
15-
go-version: "1.22"
15+
go-version: "1.23"
1616

1717
- run: go install mvdan.cc/[email protected]
1818

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-22.04
1212
strategy:
1313
matrix:
14-
go: ["1.20", "1.21", "1.22"]
14+
go: ["1.21", "1.22", "1.23"]
1515

1616
steps:
1717
- uses: actions/checkout@v4
@@ -22,7 +22,7 @@ jobs:
2222

2323
- run: make test-nodocker
2424

25-
- if: matrix.go == '1.22'
25+
- if: matrix.go == '1.23'
2626
uses: codecov/codecov-action@v3
2727
with:
2828
token: ${{ secrets.CODECOV_TOKEN }}

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
BASE_IMAGE = golang:1.22-alpine3.18
2-
LINT_IMAGE = golangci/golangci-lint:v1.59.1
1+
BASE_IMAGE = golang:1.23-alpine3.20
2+
LINT_IMAGE = golangci/golangci-lint:v1.61.0
33

44
.PHONY: $(shell ls)
55

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Features:
4141

4242
## Installation
4343

44-
1. Install Go ≥ 1.20.
44+
1. Install Go ≥ 1.21.
4545

4646
2. Create an empty folder, open a terminal in it and initialize the Go modules system:
4747

action_client.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ func NewActionClient(conf ActionClientConf) (*ActionClient, error) {
460460
Node: conf.Node,
461461
Topic: conf.Name + "/feedback",
462462
Callback: reflect.MakeFunc(
463-
reflect.FuncOf([]reflect.Type{reflect.PtrTo(ac.fbActionType)}, []reflect.Type{}, false),
463+
reflect.FuncOf([]reflect.Type{reflect.PointerTo(ac.fbActionType)}, []reflect.Type{}, false),
464464
ac.onFeedback,
465465
).Interface(),
466466
onPublisher: func() {
@@ -481,7 +481,7 @@ func NewActionClient(conf ActionClientConf) (*ActionClient, error) {
481481
Node: conf.Node,
482482
Topic: conf.Name + "/result",
483483
Callback: reflect.MakeFunc(
484-
reflect.FuncOf([]reflect.Type{reflect.PtrTo(ac.resActionType)}, []reflect.Type{}, false),
484+
reflect.FuncOf([]reflect.Type{reflect.PointerTo(ac.resActionType)}, []reflect.Type{}, false),
485485
ac.onResult,
486486
).Interface(),
487487
onPublisher: func() {
@@ -589,9 +589,9 @@ func (ac *ActionClient) SendGoal(conf ActionClientGoalConf) (*ActionClientGoalHa
589589
if conf.Goal == nil {
590590
return nil, fmt.Errorf("Goal is empty")
591591
}
592-
if reflect.TypeOf(conf.Goal) != reflect.PtrTo(ac.goalType) {
592+
if reflect.TypeOf(conf.Goal) != reflect.PointerTo(ac.goalType) {
593593
return nil, fmt.Errorf("Goal must be %s, while is %v",
594-
reflect.PtrTo(ac.goalType), reflect.TypeOf(conf.Goal))
594+
reflect.PointerTo(ac.goalType), reflect.TypeOf(conf.Goal))
595595
}
596596

597597
if conf.OnTransition != nil {
@@ -611,9 +611,9 @@ func (ac *ActionClient) SendGoal(conf ActionClientGoalConf) (*ActionClientGoalHa
611611
if cbt.NumOut() != 0 {
612612
return nil, fmt.Errorf("OnTransition must not return any value")
613613
}
614-
if cbt.In(1) != reflect.PtrTo(ac.resType) {
614+
if cbt.In(1) != reflect.PointerTo(ac.resType) {
615615
return nil, fmt.Errorf("OnTransition 2nd argument must be %s, while is %v",
616-
reflect.PtrTo(ac.resType), cbt.In(1))
616+
reflect.PointerTo(ac.resType), cbt.In(1))
617617
}
618618
}
619619

@@ -628,9 +628,9 @@ func (ac *ActionClient) SendGoal(conf ActionClientGoalConf) (*ActionClientGoalHa
628628
if cbt.NumOut() != 0 {
629629
return nil, fmt.Errorf("OnFeedback must not return any value")
630630
}
631-
if cbt.In(0) != reflect.PtrTo(ac.fbType) {
631+
if cbt.In(0) != reflect.PointerTo(ac.fbType) {
632632
return nil, fmt.Errorf("OnFeedback 1st argument must must be %s, while is %v",
633-
reflect.PtrTo(ac.fbType), cbt.In(1))
633+
reflect.PointerTo(ac.fbType), cbt.In(1))
634634
}
635635
}
636636

action_client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func TestActionClient(t *testing.T) {
128128
Node: ns,
129129
Topic: "test_action/goal",
130130
Callback: reflect.MakeFunc(
131-
reflect.FuncOf([]reflect.Type{reflect.PtrTo(reflect.TypeOf(goalAction))}, []reflect.Type{}, false),
131+
reflect.FuncOf([]reflect.Type{reflect.PointerTo(reflect.TypeOf(goalAction))}, []reflect.Type{}, false),
132132
func(in []reflect.Value) []reflect.Value {
133133
go func() {
134134
goalID := in[0].Elem().FieldByName("GoalId").

action_server.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ type ActionServerGoalHandler struct {
6262

6363
// PublishFeedback publishes a feedback about the goal,
6464
func (gh *ActionServerGoalHandler) PublishFeedback(fb interface{}) {
65-
if reflect.TypeOf(fb) != reflect.PtrTo(gh.as.fbType) {
65+
if reflect.TypeOf(fb) != reflect.PointerTo(gh.as.fbType) {
6666
panic(fmt.Errorf("argument must be %s, while is %v",
67-
reflect.PtrTo(gh.as.fbType), reflect.TypeOf(fb)))
67+
reflect.PointerTo(gh.as.fbType), reflect.TypeOf(fb)))
6868
}
6969

7070
gh.as.mutex.Lock()
@@ -90,9 +90,9 @@ func (gh *ActionServerGoalHandler) PublishFeedback(fb interface{}) {
9090
}
9191

9292
func (gh *ActionServerGoalHandler) publishResult(res interface{}) {
93-
if reflect.TypeOf(res) != reflect.PtrTo(gh.as.resType) {
93+
if reflect.TypeOf(res) != reflect.PointerTo(gh.as.resType) {
9494
panic(fmt.Errorf("argument must be %s, while is %v",
95-
reflect.PtrTo(gh.as.resType), reflect.TypeOf(res)))
95+
reflect.PointerTo(gh.as.resType), reflect.TypeOf(res)))
9696
}
9797

9898
gh.as.conf.Node.Log(LogLevelDebug, "action server '%s' has finished goal '%s' with state '%s'",
@@ -315,9 +315,9 @@ func NewActionServer(conf ActionServerConf) (*ActionServer, error) {
315315
return nil, fmt.Errorf("OnGoal 1st argument must be %s, while is %v",
316316
reflect.TypeOf(&ActionServerGoalHandler{}), cbt.In(0))
317317
}
318-
if cbt.In(1) != reflect.PtrTo(as.goalType) {
318+
if cbt.In(1) != reflect.PointerTo(as.goalType) {
319319
return nil, fmt.Errorf("OnGoal 2nd argument must be %s, while is %v",
320-
reflect.PtrTo(as.goalType), cbt.In(1))
320+
reflect.PointerTo(as.goalType), cbt.In(1))
321321
}
322322

323323
if cbt.NumOut() != 0 {
@@ -359,7 +359,7 @@ func NewActionServer(conf ActionServerConf) (*ActionServer, error) {
359359
Node: conf.Node,
360360
Topic: conf.Name + "/goal",
361361
Callback: reflect.MakeFunc(
362-
reflect.FuncOf([]reflect.Type{reflect.PtrTo(reflect.TypeOf(goalAction))}, []reflect.Type{}, false),
362+
reflect.FuncOf([]reflect.Type{reflect.PointerTo(reflect.TypeOf(goalAction))}, []reflect.Type{}, false),
363363
as.onGoal,
364364
).Interface(),
365365
})

action_server_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func TestActionServer(t *testing.T) {
110110
Node: nc,
111111
Topic: "test_action/feedback",
112112
Callback: reflect.MakeFunc(
113-
reflect.FuncOf([]reflect.Type{reflect.PtrTo(reflect.TypeOf(fbAction))}, []reflect.Type{}, false),
113+
reflect.FuncOf([]reflect.Type{reflect.PointerTo(reflect.TypeOf(fbAction))}, []reflect.Type{}, false),
114114
func(in []reflect.Value) []reflect.Value {
115115
require.Equal(t, DoSomethingActionFeedback{0.5}, in[0].Elem().FieldByName("Feedback").Interface())
116116
close(fbRecv)
@@ -125,7 +125,7 @@ func TestActionServer(t *testing.T) {
125125
Node: nc,
126126
Topic: "test_action/result",
127127
Callback: reflect.MakeFunc(
128-
reflect.FuncOf([]reflect.Type{reflect.PtrTo(reflect.TypeOf(resAction))}, []reflect.Type{}, false),
128+
reflect.FuncOf([]reflect.Type{reflect.PointerTo(reflect.TypeOf(resAction))}, []reflect.Type{}, false),
129129
func(in []reflect.Value) []reflect.Value {
130130
require.Equal(t, DoSomethingActionResult{123456}, in[0].Elem().FieldByName("Result").Interface())
131131
close(resRecv)
@@ -211,7 +211,7 @@ func TestActionServerCancelGoal(t *testing.T) {
211211
Node: nc,
212212
Topic: "test_action/result",
213213
Callback: reflect.MakeFunc(
214-
reflect.FuncOf([]reflect.Type{reflect.PtrTo(reflect.TypeOf(resAction))}, []reflect.Type{}, false),
214+
reflect.FuncOf([]reflect.Type{reflect.PointerTo(reflect.TypeOf(resAction))}, []reflect.Type{}, false),
215215
func(_ []reflect.Value) []reflect.Value {
216216
close(resRecv)
217217
return nil

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/bluenviron/goroslib/v2
22

3-
go 1.20
3+
go 1.21
44

55
require (
66
github.com/alecthomas/kong v1.2.1

0 commit comments

Comments
 (0)