Repository: numtide/treefmt (go)

Issue:
Please update module to be github.com/numtide/treefmt/v2
**Describe the bug**

[here](https://github.com/numtide/treefmt/blob/main/go.mod#L1)

When the project has versions 2.x and higher module has to end with corresponding /v2 and higher.
Otherwise Golang servers don't pick up project sources.

See details [here](https://go.dev/blog/v2-go-modules).



Pull request description:
fix: set go module to v2
Closes #475

Signed-off-by: Brian McGee <brian@bmcgee.ie>


Patch:
diff --git a/.goreleaser.yaml b/.goreleaser.yaml
index 30dbf33..6db0542 100644
--- a/.goreleaser.yaml
+++ b/.goreleaser.yaml
@@ -18,7 +18,7 @@ builds:
     - env:
           - CGO_ENABLED=0
       ldflags:
-          - -s -w -X github.com/numtide/treefmt/build.Version=v{{.Version}}
+          - -s -w -X github.com/numtide/treefmt/v2/build.Version=v{{.Version}}
       goos:
           - linux
           - darwin
diff --git a/cmd/format/format.go b/cmd/format/format.go
index 829c91a..e0f9ba9 100644
--- a/cmd/format/format.go
+++ b/cmd/format/format.go
@@ -14,11 +14,11 @@ import (
 	"time"
 
 	"github.com/charmbracelet/log"
-	"github.com/numtide/treefmt/config"
-	"github.com/numtide/treefmt/format"
-	"github.com/numtide/treefmt/stats"
-	"github.com/numtide/treefmt/walk"
-	"github.com/numtide/treefmt/walk/cache"
+	"github.com/numtide/treefmt/v2/config"
+	"github.com/numtide/treefmt/v2/format"
+	"github.com/numtide/treefmt/v2/stats"
+	"github.com/numtide/treefmt/v2/walk"
+	"github.com/numtide/treefmt/v2/walk/cache"
 	"github.com/spf13/cobra"
 	"github.com/spf13/viper"
 	bolt "go.etcd.io/bbolt"
diff --git a/cmd/root.go b/cmd/root.go
index 6d5d170..bf090e0 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -6,11 +6,11 @@ import (
 	"path/filepath"
 
 	"github.com/charmbracelet/log"
-	"github.com/numtide/treefmt/build"
-	"github.com/numtide/treefmt/cmd/format"
-	_init "github.com/numtide/treefmt/cmd/init"
-	"github.com/numtide/treefmt/config"
-	"github.com/numtide/treefmt/stats"
+	"github.com/numtide/treefmt/v2/build"
+	"github.com/numtide/treefmt/v2/cmd/format"
+	_init "github.com/numtide/treefmt/v2/cmd/init"
+	"github.com/numtide/treefmt/v2/config"
+	"github.com/numtide/treefmt/v2/stats"
 	"github.com/spf13/cobra"
 	"github.com/spf13/viper"
 )
diff --git a/config/config.go b/config/config.go
index a5035f1..252d7e8 100644
--- a/config/config.go
+++ b/config/config.go
@@ -6,7 +6,7 @@ import (
 	"path/filepath"
 	"strings"
 
-	"github.com/numtide/treefmt/walk"
+	"github.com/numtide/treefmt/v2/walk"
 	"github.com/spf13/pflag"
 	"github.com/spf13/viper"
 )
diff --git a/format/composite.go b/format/composite.go
index 7a8dd34..d5ac455 100644
--- a/format/composite.go
+++ b/format/composite.go
@@ -10,9 +10,9 @@ import (
 
 	"github.com/charmbracelet/log"
 	"github.com/gobwas/glob"
-	"github.com/numtide/treefmt/config"
-	"github.com/numtide/treefmt/stats"
-	"github.com/numtide/treefmt/walk"
+	"github.com/numtide/treefmt/v2/config"
+	"github.com/numtide/treefmt/v2/stats"
+	"github.com/numtide/treefmt/v2/walk"
 	"mvdan.cc/sh/v3/expand"
 )
 
diff --git a/format/formatter.go b/format/formatter.go
index e9d40d7..caee27a 100644
--- a/format/formatter.go
+++ b/format/formatter.go
@@ -13,8 +13,8 @@ import (
 
 	"github.com/charmbracelet/log"
 	"github.com/gobwas/glob"
-	"github.com/numtide/treefmt/config"
-	"github.com/numtide/treefmt/walk"
+	"github.com/numtide/treefmt/v2/config"
+	"github.com/numtide/treefmt/v2/walk"
 	"mvdan.cc/sh/v3/expand"
 	"mvdan.cc/sh/v3/interp"
 )
diff --git a/format/scheduler.go b/format/scheduler.go
index 490dd51..9cb514e 100644
--- a/format/scheduler.go
+++ b/format/scheduler.go
@@ -13,8 +13,8 @@ import (
 	"time"
 
 	"github.com/charmbracelet/log"
-	"github.com/numtide/treefmt/stats"
-	"github.com/numtide/treefmt/walk"
+	"github.com/numtide/treefmt/v2/stats"
+	"github.com/numtide/treefmt/v2/walk"
 	"golang.org/x/sync/errgroup"
 )
 
diff --git a/go.mod b/go.mod
index 4c29584..39863fa 100644
--- a/go.mod
+++ b/go.mod
@@ -1,4 +1,4 @@
-module github.com/numtide/treefmt
+module github.com/numtide/treefmt/v2
 
 go 1.22
 
diff --git a/main.go b/main.go
index 2bb7242..81a5431 100644
--- a/main.go
+++ b/main.go
@@ -3,7 +3,7 @@ package main
 import (
 	"os"
 
-	"github.com/numtide/treefmt/cmd"
+	"github.com/numtide/treefmt/v2/cmd"
 )
 
 func main() {
diff --git a/nix/packages/treefmt/default.nix b/nix/packages/treefmt/default.nix
index 7f6a8d0..cd3789a 100644
--- a/nix/packages/treefmt/default.nix
+++ b/nix/packages/treefmt/default.nix
@@ -42,8 +42,8 @@ in
     ldflags = [
       "-s"
       "-w"
-      "-X github.com/numtide/treefmt/build.Name=${pname}"
-      "-X github.com/numtide/treefmt/build.Version=v${version}"
+      "-X github.com/numtide/treefmt/v2/build.Name=${pname}"
+      "-X github.com/numtide/treefmt/v2/build.Version=v${version}"
     ];
 
     nativeBuildInputs =
diff --git a/walk/cached.go b/walk/cached.go
index 4f39037..aaf7c54 100644
--- a/walk/cached.go
+++ b/walk/cached.go
@@ -8,7 +8,7 @@ import (
 	"runtime"
 
 	"github.com/charmbracelet/log"
-	"github.com/numtide/treefmt/walk/cache"
+	"github.com/numtide/treefmt/v2/walk/cache"
 	bolt "go.etcd.io/bbolt"
 	"golang.org/x/sync/errgroup"
 )
diff --git a/walk/filesystem.go b/walk/filesystem.go
index 7c22e60..08ab2d4 100644
--- a/walk/filesystem.go
+++ b/walk/filesystem.go
@@ -11,7 +11,7 @@ import (
 	"strings"
 
 	"github.com/charmbracelet/log"
-	"github.com/numtide/treefmt/stats"
+	"github.com/numtide/treefmt/v2/stats"
 	"golang.org/x/sync/errgroup"
 )
 
diff --git a/walk/git.go b/walk/git.go
index fd079e6..eb4c0e0 100644
--- a/walk/git.go
+++ b/walk/git.go
@@ -11,7 +11,7 @@ import (
 	"strings"
 
 	"github.com/charmbracelet/log"
-	"github.com/numtide/treefmt/stats"
+	"github.com/numtide/treefmt/v2/stats"
 	"golang.org/x/sync/errgroup"
 )
 
diff --git a/walk/stdin.go b/walk/stdin.go
index 72dda17..3dbc133 100644
--- a/walk/stdin.go
+++ b/walk/stdin.go
@@ -7,7 +7,7 @@ import (
 	"os"
 	"path/filepath"
 
-	"github.com/numtide/treefmt/stats"
+	"github.com/numtide/treefmt/v2/stats"
 )
 
 type StdinReader struct {
diff --git a/walk/walk.go b/walk/walk.go
index 8c72735..69c09bb 100644
--- a/walk/walk.go
+++ b/walk/walk.go
@@ -10,7 +10,7 @@ import (
 	"os"
 	"path/filepath"
 
-	"github.com/numtide/treefmt/stats"
+	"github.com/numtide/treefmt/v2/stats"
 	bolt "go.etcd.io/bbolt"
 )
 


Test patch:
diff --git a/cmd/root_test.go b/cmd/root_test.go
index ee58839..e7d14e4 100644
--- a/cmd/root_test.go
+++ b/cmd/root_test.go
@@ -15,13 +15,13 @@ import (
 	"time"
 
 	"github.com/charmbracelet/log"
-	"github.com/numtide/treefmt/cmd"
-	formatCmd "github.com/numtide/treefmt/cmd/format"
-	"github.com/numtide/treefmt/config"
-	"github.com/numtide/treefmt/format"
-	"github.com/numtide/treefmt/stats"
-	"github.com/numtide/treefmt/test"
-	"github.com/numtide/treefmt/walk"
+	"github.com/numtide/treefmt/v2/cmd"
+	formatCmd "github.com/numtide/treefmt/v2/cmd/format"
+	"github.com/numtide/treefmt/v2/config"
+	"github.com/numtide/treefmt/v2/format"
+	"github.com/numtide/treefmt/v2/stats"
+	"github.com/numtide/treefmt/v2/test"
+	"github.com/numtide/treefmt/v2/walk"
 	cp "github.com/otiai10/copy"
 	"github.com/stretchr/testify/require"
 )
diff --git a/config/config_test.go b/config/config_test.go
index a87b212..d8df012 100644
--- a/config/config_test.go
+++ b/config/config_test.go
@@ -9,7 +9,7 @@ import (
 	"testing"
 
 	"github.com/BurntSushi/toml"
-	"github.com/numtide/treefmt/config"
+	"github.com/numtide/treefmt/v2/config"
 	"github.com/spf13/pflag"
 	"github.com/spf13/viper"
 	"github.com/stretchr/testify/require"
diff --git a/format/formatter_test.go b/format/formatter_test.go
index e4c416a..e3a174c 100644
--- a/format/formatter_test.go
+++ b/format/formatter_test.go
@@ -7,9 +7,9 @@ import (
 	"testing"
 	"time"
 
-	"github.com/numtide/treefmt/config"
-	"github.com/numtide/treefmt/stats"
-	"github.com/numtide/treefmt/test"
+	"github.com/numtide/treefmt/v2/config"
+	"github.com/numtide/treefmt/v2/stats"
+	"github.com/numtide/treefmt/v2/test"
 	"github.com/stretchr/testify/require"
 )
 
diff --git a/test/test.go b/test/test.go
index b1d6320..44bc8c4 100644
--- a/test/test.go
+++ b/test/test.go
@@ -8,7 +8,7 @@ import (
 	"time"
 
 	"github.com/BurntSushi/toml"
-	"github.com/numtide/treefmt/config"
+	"github.com/numtide/treefmt/v2/config"
 	cp "github.com/otiai10/copy"
 	"github.com/stretchr/testify/require"
 	"golang.org/x/sys/unix"
diff --git a/walk/filesystem_test.go b/walk/filesystem_test.go
index 8465480..4a684ad 100644
--- a/walk/filesystem_test.go
+++ b/walk/filesystem_test.go
@@ -7,9 +7,9 @@ import (
 	"testing"
 	"time"
 
-	"github.com/numtide/treefmt/stats"
-	"github.com/numtide/treefmt/test"
-	"github.com/numtide/treefmt/walk"
+	"github.com/numtide/treefmt/v2/stats"
+	"github.com/numtide/treefmt/v2/test"
+	"github.com/numtide/treefmt/v2/walk"
 	"github.com/stretchr/testify/require"
 )
 
diff --git a/walk/git_test.go b/walk/git_test.go
index 6e6177b..83103a0 100644
--- a/walk/git_test.go
+++ b/walk/git_test.go
@@ -8,9 +8,9 @@ import (
 	"testing"
 	"time"
 
-	"github.com/numtide/treefmt/stats"
-	"github.com/numtide/treefmt/test"
-	"github.com/numtide/treefmt/walk"
+	"github.com/numtide/treefmt/v2/stats"
+	"github.com/numtide/treefmt/v2/test"
+	"github.com/numtide/treefmt/v2/walk"
 	"github.com/stretchr/testify/require"
 )