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
* initial commit
Signed-off-by: RinkiyaKeDad <[email protected]>
* made code changes need to test more
Signed-off-by: RinkiyaKeDad <[email protected]>
* reverted getDepInfo function signature
Signed-off-by: RinkiyaKeDad <[email protected]>
* change -m flag help message
Signed-off-by: RinkiyaKeDad <[email protected]>
* fixed wrong max depth error
Signed-off-by: RinkiyaKeDad <[email protected]>
* updated description of max length of deps
Signed-off-by: RinkiyaKeDad <[email protected]>
Copy file name to clipboardExpand all lines: cmd/stats.go
+11-8Lines changed: 11 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@ import (
25
25
26
26
varjsonOutputbool
27
27
varverbosebool
28
+
varmainModules []string
28
29
29
30
typeChain []string
30
31
@@ -33,22 +34,23 @@ var statsCmd = &cobra.Command{
33
34
Use: "stats",
34
35
Short: "Shows metrics about dependency chains",
35
36
Long: `Provides the following metrics:
36
-
1. Total Dependencies: Total number of dependencies of the project
37
-
2. Max Depth of Dependencies: Number of dependencies in the longest dependency chain
38
-
3. Transitive Dependencies: Total number of transitive dependencies (dependencies which are not direct dependencies of the project)`,
37
+
1. Direct Dependencies: Total number of dependencies required by the mainModule(s) directly
38
+
2. Transitive Dependencies: Total number of transitive dependencies (dependencies which are further needed by direct dependencies of the project)
39
+
3. Total Dependencies: Total number of dependencies of the mainModule(s)
40
+
4. Max Depth of Dependencies: Length of the longest chain starting from the first mainModule; defaults to length from the first module encountered in "go mod graph" output`,
statsCmd.Flags().BoolVarP(&jsonOutput, "json", "j", false, "Get the output in JSON format")
123
+
statsCmd.Flags().StringSliceVarP(&mainModules, "mainModules", "m", []string{}, "Enter modules whose dependencies should be considered direct dependencies; defaults to the first module encountered in `go mod graph` output")
0 commit comments