Skip to content

Commit 5e5ce31

Browse files
committed
go: do not change module name
Go modules are not only used externally, they are used internally as well. This means that when changed in a release they effectively break the released package. It is not feasible to change all module names with a script, and generally runs against the preferences of the go community. Unfortunately this does mean that we'll have to keep an eye out for breaking changes and change the module name accordingly.
1 parent bb0440a commit 5e5ce31

7 files changed

+7
-66
lines changed

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Changelog
22

33
## [Unreleased]
4+
### Fixed
5+
- Go: Do not change version in go module ([#88](https://github.com/cucumber/polyglot-release/pull/88))
46

57
## [1.3.0] - 2022-12-02
68
### Fixed
7-
- Go: Only use major version in go module ([#86](https://github.com/cucumber/polyglot-release/pull/86))
9+
- Go: Only use major version in go module ([#86](https://github.com/cucumber/polyglot-release/pull/86))
810

911
## [1.2.0] - 2022-11-09
1012
### Added

polyglot-release

+4-11
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,12 @@ function is_monoglot_go() {
103103
[[ -f go.mod ]]
104104
}
105105
function pre_release_go() {
106-
check_for_tools "go" "jq" "sed"
106+
# noop
107+
:
107108
}
108109
function release_go() {
109-
local new_major_version
110-
new_major_version="$(echo "$NEW_VERSION" | sed -E 's/^([0-9]+)\.[0-9]+\.[0-9]+$/\1/')"
111-
# The sed below also captures 3-digit versions
112-
local module_with_new_version
113-
module_with_new_version=$(
114-
go mod edit -json |
115-
jq -r '.Module.Path' |
116-
sed -E "s/(.*)v[0-9]+(\.[0-9]+\.[0-9]+)?$/\1v$new_major_version/"
117-
)
118-
go mod edit -module "$module_with_new_version"
110+
# noop
111+
:
119112
}
120113
function post_release_go() {
121114
# noop

tests/fixtures/go-three-digit-version/CHANGELOG.md

-18
This file was deleted.

tests/fixtures/go-three-digit-version/go.mod

-3
This file was deleted.

tests/only-release-go-three-digit-version.sh

-2
This file was deleted.

tests/only-release-go-three-digit-version.sh.expected.git-commits

-25
This file was deleted.

tests/only-release-go.sh.expected.git-commits

-6
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,3 @@ diff --git a/CHANGELOG.md b/CHANGELOG.md
1717
-[Unreleased]: https://github.com/cucumber/polyglot-release/compare/v0.0.1...main
1818
+[Unreleased]: https://github.com/cucumber/polyglot-release/compare/v1.0.0...main
1919
+[1.0.0]: https://github.com/cucumber/polyglot-release/compare/v0.0.1...main
20-
diff --git a/go.mod b/go.mod
21-
--- a/go.mod
22-
+++ b/go.mod
23-
@@ -1 +1 @@
24-
-module github.com/example/project/v0
25-
+module github.com/example/project/v1

0 commit comments

Comments
 (0)