Skip to content

Commit 460ba1b

Browse files
committed
build!: move the module to /v2
`go install github.com/Flagsmith/flagsmith-cli@latest` resolves v1.1.0 — the npm-era tag, which contains no Go code — and fails with "does not contain package". Tagging v2 does not fix it: a module at major 2 or higher must carry the matching path suffix, and the +incompatible escape applies only to repos without a go.mod, so v2 tags would simply be invalid for the old path and @latest would stay on v1.1.0 forever. The suffix is unavoidable if we tag v2 at all; the alternatives were releasing the rewrite on the v1 line or dropping `go install` from the docs. The README pins the beta tag rather than using @latest, which skips prereleases when any release exists — v1.1.0 does. release-please keeps the pin current through extra-files, same as the two installers. `go install` names the binary after the module path, so it lands as flagsmith-cli; the README says so. beep boop
1 parent cd89843 commit 460ba1b

35 files changed

Lines changed: 85 additions & 84 deletions

.goreleaser.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ builds:
99
# .Tag, not .Version: `flagsmith --version` should print the tag verbatim,
1010
# and internal/version.IsRelease expects the leading v.
1111
ldflags:
12-
- -s -w -X github.com/Flagsmith/flagsmith-cli/internal/version.Version={{ .Tag }}
12+
- -s -w -X github.com/Flagsmith/flagsmith-cli/v2/internal/version.Version={{ .Tag }}
1313
mod_timestamp: "{{ .CommitTimestamp }}"
1414
goos:
1515
- linux

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ curl -fsSL https://raw.githubusercontent.com/Flagsmith/flagsmith-cli/main/instal
1919

2020
To pin the installer itself, fetch it at a commit you trust: `raw.githubusercontent.com/Flagsmith/flagsmith-cli/<sha>/install.sh`.
2121

22-
Alternatively, `go install github.com/Flagsmith/flagsmith-cli@latest`, or grab an archive from [Releases](https://github.com/Flagsmith/flagsmith-cli/releases).
22+
Alternatively, `go install github.com/Flagsmith/flagsmith-cli/v2@v2.0.0-beta.1` (installs as `flagsmith-cli`), or grab an archive from [Releases](https://github.com/Flagsmith/flagsmith-cli/releases). <!-- x-release-please-version -->
2323

2424
On Windows:
2525

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/Flagsmith/flagsmith-cli
1+
module github.com/Flagsmith/flagsmith-cli/v2
22

33
go 1.26
44

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ detect_platform() {
116116
case "$ARCH" in
117117
x86_64 | amd64) ARCH=amd64 ;;
118118
aarch64 | arm64) ARCH=arm64 ;;
119-
*) err "unsupported architecture '${ARCH}' — 'go install github.com/${REPO}@${VERSION}' builds from source" ;;
119+
*) err "unsupported architecture '${ARCH}' — 'go install github.com/${REPO}/v2@${VERSION}' builds from source" ;;
120120
esac
121121

122122
# uname reports x86_64 under Rosetta.

internal/api/client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import (
1313
"strconv"
1414
"strings"
1515

16-
"github.com/Flagsmith/flagsmith-cli/internal/bug"
16+
"github.com/Flagsmith/flagsmith-cli/v2/internal/bug"
1717

18-
"github.com/Flagsmith/flagsmith-cli/internal/httpx"
19-
"github.com/Flagsmith/flagsmith-cli/internal/version"
18+
"github.com/Flagsmith/flagsmith-cli/v2/internal/httpx"
19+
"github.com/Flagsmith/flagsmith-cli/v2/internal/version"
2020
)
2121

2222
// Auth applies an Authorization scheme to a request.

internal/auth/oauth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"strings"
1616
"time"
1717

18-
"github.com/Flagsmith/flagsmith-cli/internal/bug"
18+
"github.com/Flagsmith/flagsmith-cli/v2/internal/bug"
1919
)
2020

2121
const (

internal/auth/store.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"strings"
88
"time"
99

10-
"github.com/Flagsmith/flagsmith-cli/internal/bug"
10+
"github.com/Flagsmith/flagsmith-cli/v2/internal/bug"
1111

1212
"github.com/zalando/go-keyring"
1313
)

internal/cmd/api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ import (
1313
"strconv"
1414
"strings"
1515

16-
"github.com/Flagsmith/flagsmith-cli/internal/bug"
16+
"github.com/Flagsmith/flagsmith-cli/v2/internal/bug"
1717

1818
"github.com/spf13/cobra"
1919

20-
"github.com/Flagsmith/flagsmith-cli/internal/output"
20+
"github.com/Flagsmith/flagsmith-cli/v2/internal/output"
2121
)
2222

2323
var (

internal/cmd/auth.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import (
1111

1212
"github.com/spf13/cobra"
1313

14-
"github.com/Flagsmith/flagsmith-cli/internal/api"
15-
"github.com/Flagsmith/flagsmith-cli/internal/auth"
16-
"github.com/Flagsmith/flagsmith-cli/internal/cache"
17-
"github.com/Flagsmith/flagsmith-cli/internal/output"
14+
"github.com/Flagsmith/flagsmith-cli/v2/internal/api"
15+
"github.com/Flagsmith/flagsmith-cli/v2/internal/auth"
16+
"github.com/Flagsmith/flagsmith-cli/v2/internal/cache"
17+
"github.com/Flagsmith/flagsmith-cli/v2/internal/output"
1818
)
1919

2020
const (

internal/cmd/client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"net/http"
55
"sync"
66

7-
"github.com/Flagsmith/flagsmith-cli/internal/api"
8-
"github.com/Flagsmith/flagsmith-cli/internal/httpx"
9-
"github.com/Flagsmith/flagsmith-cli/internal/version"
7+
"github.com/Flagsmith/flagsmith-cli/v2/internal/api"
8+
"github.com/Flagsmith/flagsmith-cli/v2/internal/httpx"
9+
"github.com/Flagsmith/flagsmith-cli/v2/internal/version"
1010
)
1111

1212
// userAgent identifies the CLI on every outbound request.

0 commit comments

Comments
 (0)