diff --git a/.github/workflows/build-with-cfg.yml b/.github/workflows/build-with-cfg.yml index 26f35b8e..93d66ed1 100644 --- a/.github/workflows/build-with-cfg.yml +++ b/.github/workflows/build-with-cfg.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: ${{ inputs.go-version || '^1.20' }} + go-version: ${{ inputs.go-version || '^1.22' }} check-latest: true - run: | diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 47ca9cf8..afe37239 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -17,8 +17,8 @@ jobs: matrix: include: # test build of oldest supported go version - - name: go1.20 - go-version: "~1.20" + - name: go1.22 + go-version: "~1.22" uses: ./.github/workflows/build-with-cfg.yml with: go-version: ${{ matrix.go-version }} diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index a105b2d0..65807147 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -16,10 +16,10 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Set up Go 1.20+ + - name: Set up Go 1.22+ uses: actions/setup-go@v5 with: - go-version: "^1.20" # The Go version to download (if necessary) and use. + go-version: "^1.22" # The Go version to download (if necessary) and use. check-latest: true cache: false diff --git a/.github/workflows/test-with-cfg.yml b/.github/workflows/test-with-cfg.yml index 6864075b..b7e27b10 100644 --- a/.github/workflows/test-with-cfg.yml +++ b/.github/workflows/test-with-cfg.yml @@ -37,10 +37,10 @@ jobs: - name: Shallow checkout uses: actions/checkout@v4 - - name: Set up Go 1.20+ + - name: Set up Go 1.22+ uses: actions/setup-go@v5 with: - go-version: "^1.20" + go-version: "^1.22" check-latest: true - run: go version diff --git a/.golangci.yml b/.golangci.yml index 05d872c0..694207db 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -163,4 +163,4 @@ issues: # fix: true run: - go: "1.20" + go: "1.22" diff --git a/README.md b/README.md index d62a3fd9..d98a596b 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The **client** enables interaction with devices in a local network: ## Requirements -- Go 1.20 or higher +- Go 1.22 or higher ## Installation OCF Client diff --git a/bridge/resources/thingDescription/resource_test.go b/bridge/resources/thingDescription/resource_test.go index eb770820..82716b80 100644 --- a/bridge/resources/thingDescription/resource_test.go +++ b/bridge/resources/thingDescription/resource_test.go @@ -25,6 +25,7 @@ import ( "testing" "time" + v2json "github.com/go-json-experiment/json" "github.com/google/uuid" bridgeDeviceTD "github.com/plgd-dev/device/v2/bridge/device/thingDescription" thingDescriptionResource "github.com/plgd-dev/device/v2/bridge/resources/thingDescription" @@ -77,10 +78,10 @@ func (JSONCodec) Decode(m *pool.Message, v interface{}) error { func getThingDescription(t *testing.T, data interface{}) wotTD.ThingDescription { tdMap, ok := data.(map[interface{}]interface{}) require.True(t, ok) - jsonData, err := json.Encode(tdMap) + jsonData, err := v2json.Marshal(tdMap) require.NoError(t, err) td := wotTD.ThingDescription{} - err = json.Decode(jsonData, &td) + err = v2json.Unmarshal(jsonData, &td) require.NoError(t, err) return td } @@ -246,8 +247,9 @@ func TestObserveThingDescription(t *testing.T) { id, err := bridgeDeviceTD.GetThingDescriptionID(deviceID.String()) require.NoError(t, err) td2 := wotTD.ThingDescription{ - Base: *base, - ID: id, + Base: *base, + ID: id, + SecurityDefinitions: map[string]wotTD.SecurityScheme{}, } d.GetThingDescriptionManager().NotifySubscriptions(td2) n, err = h.WaitForNotification(ctx) diff --git a/cmd/bridge-device/Dockerfile b/cmd/bridge-device/Dockerfile index 843d84b3..4ffb9df1 100644 --- a/cmd/bridge-device/Dockerfile +++ b/cmd/bridge-device/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1 -FROM golang:1.20.14-alpine AS build +FROM golang:1.22.3-alpine AS build RUN apk add --no-cache curl git build-base WORKDIR $GOPATH/src/github.com/plgd-dev/device COPY go.mod go.sum ./ diff --git a/go.mod b/go.mod index 6b7bb53c..396e2a8c 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/plgd-dev/device/v2 -go 1.21 +go 1.22 toolchain go1.22.0 diff --git a/test/cloud-server/Dockerfile b/test/cloud-server/Dockerfile index 59e6fbb2..f0a435f2 100644 --- a/test/cloud-server/Dockerfile +++ b/test/cloud-server/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.20.14-alpine AS build +FROM golang:1.22.3-alpine AS build RUN apk add --no-cache curl git build-base WORKDIR $GOPATH/src/github.com/plgd-dev/device COPY go.mod go.sum ./