From 2eb0f9878772d64454356ba254a514f812021310 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Jun 2024 00:26:10 +0000 Subject: [PATCH 1/4] build(deps): bump golang.org/x/tools from 0.19.0 to 0.22.0 Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.19.0 to 0.22.0. - [Release notes](https://github.com/golang/tools/releases) - [Commits](https://github.com/golang/tools/compare/v0.19.0...v0.22.0) --- updated-dependencies: - dependency-name: golang.org/x/tools dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 461f621b..833d9471 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/goplus/gogen go 1.18 -require golang.org/x/tools v0.19.0 +require golang.org/x/tools v0.22.0 retract ( v1.12.7 diff --git a/go.sum b/go.sum index 08a82a92..bf4be9a5 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,4 @@ -golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= -golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= +golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= +golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= From 13f7ad45d3c7d2c68d86d2a6617e038f6ff6957f Mon Sep 17 00:00:00 2001 From: xushiwei Date: Wed, 5 Jun 2024 09:24:15 +0800 Subject: [PATCH 2/4] go1.19 --- .github/workflows/go.yml | 2 +- go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 57662e33..8b643af9 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -10,7 +10,7 @@ jobs: Test: strategy: matrix: - go-version: [1.18.x, 1.21.x] + go-version: [1.19.x, 1.21.x] os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} steps: diff --git a/go.mod b/go.mod index 461f621b..daf4b616 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/goplus/gogen -go 1.18 +go 1.19 require golang.org/x/tools v0.19.0 From f65a55200e6abf18fa73cbfd447f40024c6c7498 Mon Sep 17 00:00:00 2001 From: xushiwei Date: Thu, 8 Aug 2024 23:40:37 +0800 Subject: [PATCH 3/4] rollback golang.org/x/tools v0.22.0 => v0.19.0 --- go.mod | 2 +- go.sum | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 519a4082..daf4b616 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/goplus/gogen go 1.19 -require golang.org/x/tools v0.22.0 +require golang.org/x/tools v0.19.0 retract ( v1.12.7 diff --git a/go.sum b/go.sum index bf4be9a5..08a82a92 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,4 @@ -golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= +golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= From da0abe45951c1538aa68d222b5d703f441d1059e Mon Sep 17 00:00:00 2001 From: tsingbx Date: Wed, 25 Sep 2024 10:29:25 +0800 Subject: [PATCH 4/4] modify stripCommonPrefix to fix panic --- internal/go/printer/printer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/go/printer/printer.go b/internal/go/printer/printer.go index a4897835..a2b9582f 100644 --- a/internal/go/printer/printer.go +++ b/internal/go/printer/printer.go @@ -609,7 +609,7 @@ func stripCommonPrefix(lines []string) { last := lines[len(lines)-1] closing := "*/" i := strings.Index(last, closing) // i >= 0 (closing is always present) - if isBlank(last[0:i]) { + if i >= 0 && isBlank(last[0:i]) { // last line only contains closing */ if lineOfStars { closing = " */" // add blank to align final star