Skip to content

Commit

Permalink
bump Golang to 1.23 (#3702)
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 authored Nov 4, 2024
1 parent d3b4a26 commit 576a117
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/code_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: "1.22"
go-version: "1.23"

- run: go generate ./...

- uses: golangci/golangci-lint-action@v4
with:
version: v1.55.0
version: v1.61.0

mod_tidy:
runs-on: ubuntu-22.04
Expand All @@ -33,7 +33,7 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: "1.22"
go-version: "1.23"

- run: make lint-mod-tidy

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: "1.22"
go-version: "1.23"

- run: make test-highlevel-nodocker
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BASE_IMAGE = golang:1.22-alpine3.19
LINT_IMAGE = golangci/golangci-lint:v1.59.1
NODE_IMAGE = node:20-alpine3.19
ALPINE_IMAGE = alpine:3.19
BASE_IMAGE = golang:1.23-alpine3.20
LINT_IMAGE = golangci/golangci-lint:v1.61.0
NODE_IMAGE = node:20-alpine3.20
ALPINE_IMAGE = alpine:3.20
RPI32_IMAGE = balenalib/raspberry-pi:bullseye-run-20240508
RPI64_IMAGE = balenalib/raspberrypi3-64:bullseye-run-20240429

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2290,7 +2290,7 @@ Be aware that RTMPS is currently unsupported by all major players. However, you
### Standard
Install git and Go ≥ 1.22. Clone the repository, enter into the folder and start the building process:
Install git and Go ≥ 1.23. Clone the repository, enter into the folder and start the building process:
```sh
git clone https://github.com/bluenviron/mediamtx
Expand Down Expand Up @@ -2331,7 +2331,7 @@ If you need to use a custom or external libcamera when interacting with the Rasp
Cross compilation allows to build an executable for a target machine from another machine with different operating system or architecture. This is useful in case the target machine doesn't have enough resources for compilation or if you don't want to install the compilation dependencies on it.
On the machine you want to use to compile, install git and Go ≥ 1.22. Clone the repository, enter into the folder and start the building process:
On the machine you want to use to compile, install git and Go ≥ 1.23. Clone the repository, enter into the folder and start the building process:
```sh
git clone https://github.com/bluenviron/mediamtx
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/bluenviron/mediamtx

go 1.22
go 1.23

require (
code.cloudfoundry.org/bytefmt v0.0.0
Expand Down
14 changes: 7 additions & 7 deletions internal/api/paginate.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ func paginate2(itemsPtr interface{}, itemsPerPage int, page int) int {
pageCount++
}

min := page * itemsPerPage
if min > itemsLen {
min = itemsLen
minVal := page * itemsPerPage
if minVal > itemsLen {
minVal = itemsLen
}

max := (page + 1) * itemsPerPage
if max > itemsLen {
max = itemsLen
maxVal := (page + 1) * itemsPerPage
if maxVal > itemsLen {
maxVal = itemsLen
}

ritems.Set(ritems.Slice(min, max))
ritems.Set(ritems.Slice(minVal, maxVal))

return pageCount
}
Expand Down
2 changes: 1 addition & 1 deletion internal/conf/optional_global.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var optionalGlobalValuesType = func() reflect.Type {

typ := f.Type
if typ.Kind() != reflect.Pointer {
typ = reflect.PtrTo(typ)
typ = reflect.PointerTo(typ)
}

fields = append(fields, reflect.StructField{
Expand Down
2 changes: 1 addition & 1 deletion internal/conf/optional_path.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var optionalPathValuesType = func() reflect.Type {

typ := f.Type
if typ.Kind() != reflect.Pointer {
typ = reflect.PtrTo(typ)
typ = reflect.PointerTo(typ)
}

fields = append(fields, reflect.StructField{
Expand Down
4 changes: 2 additions & 2 deletions internal/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ func writeTime(buf *bytes.Buffer, t time.Time, useColor bool) {
intbuf.WriteByte(' ')

// time
hour, min, sec := t.Clock()
hour, minute, sec := t.Clock()
intbuf.Write(itoa(hour, 2))
intbuf.WriteByte(':')
intbuf.Write(itoa(min, 2))
intbuf.Write(itoa(minute, 2))
intbuf.WriteByte(':')
intbuf.Write(itoa(sec, 2))
intbuf.WriteByte(' ')
Expand Down
4 changes: 2 additions & 2 deletions internal/servers/webrtc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ func randInt63n(n int64) (int64, error) {
return r & (n - 1), nil
}

max := int64((1 << 63) - 1 - (1<<63)%uint64(n))
maxVal := int64((1 << 63) - 1 - (1<<63)%uint64(n))

v, err := randInt63()
if err != nil {
return 0, err
}

for v > max {
for v > maxVal {
v, err = randInt63()
if err != nil {
return 0, err
Expand Down

0 comments on commit 576a117

Please sign in to comment.