diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1e17a21f4ba..92c421b98cf 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,7 +6,7 @@ "dockerfile": "Dockerfile", "args": { // Update the VARIANT arg to pick a version of Go - "VARIANT": "1.24", + "VARIANT": "1.26", // Options "INSTALL_NODE": "false", "NODE_VERSION": "lts/*" diff --git a/.github/workflows/adapter-code-coverage.yml b/.github/workflows/adapter-code-coverage.yml index 10dd9e89773..ed7aef14484 100644 --- a/.github/workflows/adapter-code-coverage.yml +++ b/.github/workflows/adapter-code-coverage.yml @@ -15,7 +15,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: 1.24.0 + go-version: 1.26.2 - name: Checkout Code uses: actions/checkout@v4 @@ -46,6 +46,8 @@ jobs: - name: Run Coverage Tests id: run_coverage if: steps.get_directories.outputs.result != '' + env: + GOTOOLCHAIN: local run: | directories=$(echo '${{ steps.get_directories.outputs.result }}' | jq -r '.[]') go mod download diff --git a/.github/workflows/validate-merge.yml b/.github/workflows/validate-merge.yml index ca633d47465..64a611f537c 100644 --- a/.github/workflows/validate-merge.yml +++ b/.github/workflows/validate-merge.yml @@ -12,7 +12,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: 1.24.0 + go-version: 1.26.2 - name: Checkout Merged Branch uses: actions/checkout@v4 diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index df71d61612a..b8d5ea7a550 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -10,7 +10,7 @@ jobs: validate: strategy: matrix: - go-version: [1.23.x, 1.24.x] + go-version: [1.25.x, 1.26.x] os: [ubuntu-latest] runs-on: ${{ matrix.os }} @@ -31,3 +31,4 @@ jobs: ./validate.sh --nofmt --cov --race 10 env: GO111MODULE: "on" + GOTOOLCHAIN: local diff --git a/Dockerfile b/Dockerfile index 6c0295688bb..26396cdc9a3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,8 @@ RUN apt-get update && \ apt-get -y upgrade && \ apt-get install -y --no-install-recommends wget ca-certificates WORKDIR /tmp -RUN wget https://dl.google.com/go/go1.24.0.linux-amd64.tar.gz && \ - tar -xf go1.24.0.linux-amd64.tar.gz && \ +RUN wget https://dl.google.com/go/go1.26.2.linux-amd64.tar.gz && \ + tar -xf go1.26.2.linux-amd64.tar.gz && \ mv go /usr/local RUN mkdir -p /app/prebid-server/ WORKDIR /app/prebid-server/ diff --git a/README.md b/README.md index 0aa629ebc25..2323db2d09c 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Ensure that you deploy the `/static` directory, as Prebid Server requires those ## Developing -Prebid Server requires [Go](https://go.dev) version 1.23 or newer. You can develop on any operating system that Go supports; however, please note that our helper scripts are written in bash. +Prebid Server requires [Go](https://go.dev) version 1.26.2 or newer. You can develop on any operating system that Go supports; however, please note that our helper scripts are written in bash. 1. Clone The Repository ``` bash diff --git a/adapters/adapterstest/adapter_test_util.go b/adapters/adapterstest/adapter_test_util.go index d58437b8fd8..7faecb8948f 100644 --- a/adapters/adapterstest/adapter_test_util.go +++ b/adapters/adapterstest/adapter_test_util.go @@ -45,21 +45,21 @@ func SampleBid(width *int64, height *int64, impId string, index int) openrtb2.Bi // VerifyStringValue Helper function to assert string equals. func VerifyStringValue(value string, expected string, t *testing.T) { if value != expected { - t.Fatalf(fmt.Sprintf("%s expected, got %s", expected, value)) + t.Fatalf("%s expected, got %s", expected, value) } } // VerifyIntValue Helper function to assert Int equals. func VerifyIntValue(value int, expected int, t *testing.T) { if value != expected { - t.Fatalf(fmt.Sprintf("%d expected, got %d", expected, value)) + t.Fatalf("%d expected, got %d", expected, value) } } // VerifyBoolValue Helper function to assert bool equals. func VerifyBoolValue(value bool, expected bool, t *testing.T) { if value != expected { - t.Fatalf(fmt.Sprintf("%v expected, got %v", expected, value)) + t.Fatalf("%v expected, got %v", expected, value) } } diff --git a/endpoints/openrtb2/amp_auction_test.go b/endpoints/openrtb2/amp_auction_test.go index 44aeb23da62..cb31a2b6ed6 100644 --- a/endpoints/openrtb2/amp_auction_test.go +++ b/endpoints/openrtb2/amp_auction_test.go @@ -2491,7 +2491,7 @@ func TestAmpAuctionDebugWarningsOnly(t *testing.T) { ) for _, test := range testCases { - httpReq := httptest.NewRequest("GET", fmt.Sprintf("/openrtb2/auction/amp"+test.requestURLArguments), nil) + httpReq := httptest.NewRequest("GET", "/openrtb2/auction/amp"+test.requestURLArguments, nil) test.addRequestHeaders(httpReq) recorder := httptest.NewRecorder() diff --git a/exchange/bidder.go b/exchange/bidder.go index e96fdc1a896..87d3eaa719a 100644 --- a/exchange/bidder.go +++ b/exchange/bidder.go @@ -616,7 +616,7 @@ func (bidder *BidderAdapter) doRequestImpl(ctx context.Context, req *adapters.Re httpResp, err := ctxhttp.Do(ctx, bidder.Client, httpReq) if err != nil { bidder.logHealthCheck(false) - if err == context.DeadlineExceeded { + if errors.Is(err, context.DeadlineExceeded) { err = &errortypes.Timeout{Message: err.Error()} var corebidder adapters.Bidder = bidder.Bidder // The bidder adapter normally stores an info-aware bidder (a bidder wrapper) @@ -631,7 +631,6 @@ func (bidder *BidderAdapter) doRequestImpl(ctx context.Context, req *adapters.Re // a loop of trying to report timeouts to the timeout notifications. go bidder.doTimeoutNotification(tb, req, logger) } - } return &httpCallInfo{ request: req, diff --git a/go.mod b/go.mod index ec92fd3eed3..843178cd1f2 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/prebid/prebid-server/v4 -go 1.23.0 +go 1.25 require ( github.com/51Degrees/device-detection-go/v4 v4.4.35 diff --git a/modules/fiftyonedegrees/devicedetection/hook_raw_auction_request.go b/modules/fiftyonedegrees/devicedetection/hook_raw_auction_request.go index 4f5580a5c75..9492b4cb089 100644 --- a/modules/fiftyonedegrees/devicedetection/hook_raw_auction_request.go +++ b/modules/fiftyonedegrees/devicedetection/hook_raw_auction_request.go @@ -3,7 +3,6 @@ package devicedetection import ( - "fmt" "math" "github.com/prebid/prebid-server/v4/hooks/hookexecution" @@ -37,7 +36,7 @@ func handleAuctionRequestHook(ctx hookstage.ModuleInvocationContext, deviceDetec result, err := hydrateFields(deviceInfo, rawPayload) if err != nil { - return rawPayload, hookexecution.NewFailure(fmt.Sprintf("error hydrating fields %s", err)) + return rawPayload, hookexecution.NewFailure("error hydrating fields %s", err) } return result, nil