Skip to content

Commit 38743af

Browse files
committed
Revert v1 module paths to include /v1 for consistency with folder structure
1 parent b9232ef commit 38743af

6 files changed

Lines changed: 7 additions & 7 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This repository demonstrates how to maintain multiple major versions of multiple
44

55
## Why /vN in Module Paths?
66

7-
Go requires the `/vN` suffix in module paths for major versions greater than 1 to enable semantic versioning. This allows different major versions to coexist without conflicts, as each version is treated as a separate module. For example, `github.com/DakshithaS/go-multi-major-modules/rate-limit/v2` is distinct from `github.com/DakshithaS/go-multi-major-modules/rate-limit`.
7+
Go requires the `/vN` suffix in module paths for major versions greater than 1 to enable semantic versioning. This allows different major versions to coexist without conflicts, as each version is treated as a separate module. For example, `github.com/DakshithaS/go-multi-major-modules/rate-limit/v2` is distinct from `github.com/DakshithaS/go-multi-major-modules/rate-limit/v1`.
88

99
## Why Version Folders Instead of Branches or Separate Repositories?
1010

@@ -45,7 +45,7 @@ Avoid this approach when:
4545
To use a specific version of a module, import it with the appropriate `/vN` suffix:
4646

4747
```go
48-
import "github.com/DakshithaS/go-multi-major-modules/rate-limit"
48+
import "github.com/DakshithaS/go-multi-major-modules/rate-limit/v1"
4949
// or
5050
import "github.com/DakshithaS/go-multi-major-modules/rate-limit/v2"
5151
// or

add-header/v1/add_header_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"net/http/httptest"
55
"testing"
66

7-
addheader "github.com/DakshithaS/go-multi-major-modules/add-header/src"
7+
addheader "github.com/DakshithaS/go-multi-major-modules/add-header/v1/src"
88
)
99

1010
func TestAddHeader(t *testing.T) {

add-header/v1/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module github.com/DakshithaS/go-multi-major-modules/add-header
1+
module github.com/DakshithaS/go-multi-major-modules/add-header/v1
22

33
go 1.21

rate-limit/v1/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module github.com/DakshithaS/go-multi-major-modules/rate-limit
1+
module github.com/DakshithaS/go-multi-major-modules/rate-limit/v1
22

33
go 1.21

rate-limit/v1/rate_limit_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"testing"
55
"time"
66

7-
"github.com/DakshithaS/go-multi-major-modules/rate-limit/src"
7+
ratelimit "github.com/DakshithaS/go-multi-major-modules/rate-limit/v1/src"
88
)
99

1010
func TestRateLimiter(t *testing.T) {

rate-limit/v2/rate_limit_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"testing"
55
"time"
66

7-
"github.com/DakshithaS/go-multi-major-modules/rate-limit/v2/src"
7+
ratelimit "github.com/DakshithaS/go-multi-major-modules/rate-limit/v2/src"
88
)
99

1010
func TestRateLimiter(t *testing.T) {

0 commit comments

Comments
 (0)