Skip to content

Commit

Permalink
gofumpt
Browse files Browse the repository at this point in the history
Signed-off-by: Kartikay <[email protected]>
  • Loading branch information
kartikaysaxena committed Jan 28, 2025
1 parent deede2e commit 8a20dd1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion magefiles/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
package main

import (
"os"

"github.com/authzed/zed/internal/cmd"
"github.com/jzelinskie/cobrautil/v2/cobrazerolog"
"github.com/magefile/mage/mg"
"os"
)

type Gen mg.Namespace
Expand Down
11 changes: 5 additions & 6 deletions magefiles/util.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build mage
// +build mage

package main

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

func GenCustomMarkdownTree(cmd *cobra.Command, dir string) error {

basename := strings.ReplaceAll(cmd.CommandPath(), " ", "_") + ".md"
filename := filepath.Join(dir, basename)

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

return genMarkdownTreeCustom(cmd, f)

}

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

func printOptions(buf *bytes.Buffer, cmd *cobra.Command) error {

flags := cmd.NonInheritedFlags()
flags.SetOutput(buf)

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

if flags.HasAvailableFlags() {
if parentFlags.HasAvailableFlags() {
buf.WriteString("### Options Inherited From Parent Flags\n\n```\n")
flags.PrintDefaults()
parentFlags.PrintDefaults()
buf.WriteString("```\n\n")
}

return nil

}

0 comments on commit 8a20dd1

Please sign in to comment.