Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump Golang to 1.23 #3702

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
intbuf.WriteByte(' ')

// time
hour, min, sec := t.Clock()
hour, minute, sec := t.Clock()

Check warning on line 90 in internal/logger/logger.go

View check run for this annotation

Codecov / codecov/patch

internal/logger/logger.go#L90

Added line #L90 was not covered by tests
intbuf.Write(itoa(hour, 2))
intbuf.WriteByte(':')
intbuf.Write(itoa(min, 2))
intbuf.Write(itoa(minute, 2))

Check warning on line 93 in internal/logger/logger.go

View check run for this annotation

Codecov / codecov/patch

internal/logger/logger.go#L93

Added line #L93 was not covered by tests
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 @@
return r & (n - 1), nil
}

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

Check warning on line 68 in internal/servers/webrtc/server.go

View check run for this annotation

Codecov / codecov/patch

internal/servers/webrtc/server.go#L68

Added line #L68 was not covered by tests

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

for v > max {
for v > maxVal {

Check warning on line 75 in internal/servers/webrtc/server.go

View check run for this annotation

Codecov / codecov/patch

internal/servers/webrtc/server.go#L75

Added line #L75 was not covered by tests
v, err = randInt63()
if err != nil {
return 0, err
Expand Down
Loading