You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/generate.go
+90-5Lines changed: 90 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,18 @@
1
1
package cmd
2
2
3
3
import (
4
-
"embed"// For embedding templates
4
+
"embed"
5
+
5
6
"fmt"
6
-
"net"// For checking port availability in generateCmd
7
+
"net"
7
8
"os"
8
-
"path/filepath"// For path manipulation
9
-
"strconv"// For string to int conversion
9
+
"path/filepath"
10
+
"strconv"
11
+
"os/exec"
10
12
11
13
"github.com/spf13/cobra"
12
14
)
13
15
14
-
// CustomError is a simple wrapper for errors, useful for consistent error handling.
15
16
typeCustomErrorstruct {
16
17
Errerror
17
18
}
@@ -226,9 +227,93 @@ var listServicesCmd = &cobra.Command{
226
227
},
227
228
}
228
229
230
+
// modTidyAllCmd is the new Cobra command to run 'go mod tidy' in the pkg/ and all service directories.
231
+
varmodTidyAllCmd=&cobra.Command{
232
+
Use: "mod-tidy-all",
233
+
Short: "Runs 'go mod tidy' in pkg/ and all generated service directories",
234
+
Long: "Executes 'go mod tidy' in the 'pkg/' folder and then in each subdirectory within the 'services/' folder, ensuring all module dependencies are clean.",
0 commit comments