From 79c1ded02fb647eda2195ca2cba438678d941a96 Mon Sep 17 00:00:00 2001 From: "franca.winter" Date: Mon, 5 Oct 2026 11:18:24 +0200 Subject: [PATCH 1/2] fix(cli): add testify to Go template and bump CLI indirect dep The go Makefile target runs `cd clients/go && go mod tidy` after generating phrase-go. Since clients/go/test/ contains committed test files that import testify, tidy adds testify v1.12.1 to go.mod. The verification build then compares the CLI's go.mod (testify v1.9.0) against the local phrase-go (testify v1.12.1) and fails with "go: updates to go.mod needed". Fix: - Add testify v1.12.1 and go.yaml.in/yaml/v3 v3.0.5 to go.mod.mustache so that `go mod tidy` in clients/go is a no-op for testify - Update the template go.sum with testify v1.12.1 and go.yaml.in checksums - Bump testify in clients/cli/go.mod from v1.9.0 to v1.12.1 so the verification build's module graph is already satisfied - Run `go mod tidy` to update clients/cli/go.sum Co-Authored-By: Claude Sonnet 4.6 --- clients/cli/go.mod | 2 +- clients/cli/go.sum | 7 ++++--- openapi-generator/templates/go/go.mod.mustache | 3 +++ openapi-generator/templates/go/go.sum | 4 ++++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/clients/cli/go.mod b/clients/cli/go.mod index 0f976d3d8..ae6a8c7ae 100644 --- a/clients/cli/go.mod +++ b/clients/cli/go.mod @@ -27,7 +27,7 @@ require ( github.com/spf13/cast v1.7.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/testify v1.9.0 // indirect + github.com/stretchr/testify v1.12.1 // indirect github.com/subosito/gotenv v1.6.0 // indirect golang.org/x/oauth2 v0.37.0 // indirect golang.org/x/sys v0.48.0 // indirect diff --git a/clients/cli/go.sum b/clients/cli/go.sum index 6f772a5ac..aa8247d8c 100644 --- a/clients/cli/go.sum +++ b/clients/cli/go.sum @@ -157,7 +157,6 @@ github.com/phrase/phrase-go/v4 v4.32.0 h1:LrYLt0qak06SldoYBLJ9UY/n8FVLZk8glN6xz1 github.com/phrase/phrase-go/v4 v4.32.0/go.mod h1:coMK4wg6WwpltJhrLUkUIQ2gwFAkAHd0IXBGoAJTejo= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -201,8 +200,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= @@ -214,6 +213,8 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= diff --git a/openapi-generator/templates/go/go.mod.mustache b/openapi-generator/templates/go/go.mod.mustache index 14d72ab29..70f62f6b4 100644 --- a/openapi-generator/templates/go/go.mod.mustache +++ b/openapi-generator/templates/go/go.mod.mustache @@ -4,6 +4,9 @@ go 1.23 require ( github.com/antihax/optional v1.0.0 + github.com/stretchr/testify v1.12.1 golang.org/x/oauth2 v0.27.0 gopkg.in/yaml.v2 v2.4.0 ) + +require go.yaml.in/yaml/v3 v3.0.5 // indirect diff --git a/openapi-generator/templates/go/go.sum b/openapi-generator/templates/go/go.sum index c7a61e79c..adc1e8fcc 100644 --- a/openapi-generator/templates/go/go.sum +++ b/openapi-generator/templates/go/go.sum @@ -2,6 +2,10 @@ github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwc github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M= golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= From 7c29f7ea9895f24cd00031bbcacec1248597ff9d Mon Sep 17 00:00:00 2001 From: "franca.winter" Date: Mon, 5 Oct 2026 11:26:53 +0200 Subject: [PATCH 2/2] fix(go-template): use go 1.23.0 to prevent tidy normalizing the directive Go 1.21+ normalizes two-part go directives (go 1.23) to three-part (go 1.23.0) when running go mod tidy, causing a persistent diff in the generated phrase-go go.mod on every CI run. Co-Authored-By: Claude Sonnet 4.6 --- openapi-generator/templates/go/go.mod.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi-generator/templates/go/go.mod.mustache b/openapi-generator/templates/go/go.mod.mustache index 70f62f6b4..10efa86e0 100644 --- a/openapi-generator/templates/go/go.mod.mustache +++ b/openapi-generator/templates/go/go.mod.mustache @@ -1,6 +1,6 @@ module {{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}}/v4 {{! x-release-please-major }} -go 1.23 +go 1.23.0 require ( github.com/antihax/optional v1.0.0