Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 108c6ad

Browse files
kartikaysaxenatstirrat15
authored andcommittedFeb 6, 2025··
gofumpt
Signed-off-by: Kartikay <[email protected]>
1 parent 1f3a82b commit 108c6ad

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
 

‎magefiles/magefile.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
package main
55

66
import (
7+
"os"
8+
79
"github.com/authzed/zed/internal/cmd"
810
"github.com/jzelinskie/cobrautil/v2/cobrazerolog"
911
"github.com/magefile/mage/mg"
10-
"os"
1112
)
1213

1314
type Gen mg.Namespace

‎magefiles/util.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//go:build mage
2+
// +build mage
3+
14
package main
25

36
import (
@@ -23,7 +26,6 @@ func (s byName) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
2326
func (s byName) Less(i, j int) bool { return s[i].Name() < s[j].Name() }
2427

2528
func GenCustomMarkdownTree(cmd *cobra.Command, dir string) error {
26-
2729
basename := strings.ReplaceAll(cmd.CommandPath(), " ", "_") + ".md"
2830
filename := filepath.Join(dir, basename)
2931

@@ -34,7 +36,6 @@ func GenCustomMarkdownTree(cmd *cobra.Command, dir string) error {
3436
defer f.Close()
3537

3638
return genMarkdownTreeCustom(cmd, f)
37-
3839
}
3940

4041
func genMarkdownTreeCustom(cmd *cobra.Command, f *os.File) error {
@@ -132,7 +133,6 @@ func hasSeeAlso(cmd *cobra.Command) bool {
132133
}
133134

134135
func printOptions(buf *bytes.Buffer, cmd *cobra.Command) error {
135-
136136
flags := cmd.NonInheritedFlags()
137137
flags.SetOutput(buf)
138138

@@ -145,12 +145,11 @@ func printOptions(buf *bytes.Buffer, cmd *cobra.Command) error {
145145
parentFlags := cmd.InheritedFlags()
146146
parentFlags.SetOutput(buf)
147147

148-
if flags.HasAvailableFlags() {
148+
if parentFlags.HasAvailableFlags() {
149149
buf.WriteString("### Options Inherited From Parent Flags\n\n```\n")
150-
flags.PrintDefaults()
150+
parentFlags.PrintDefaults()
151151
buf.WriteString("```\n\n")
152152
}
153153

154154
return nil
155-
156155
}

0 commit comments

Comments
 (0)
Please sign in to comment.