From cf0d0e15faeabbdfa79caec505cf4ac31488eb56 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 21 Nov 2025 09:06:01 +0800 Subject: style: gofmt all code --- main.go | 60 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 237fdb7..d7ada82 100644 --- a/main.go +++ b/main.go @@ -1,42 +1,42 @@ package main import ( - "fmt" - "os" - "context" - "log" - "github.com/fatih/color" - "github.com/urfave/cli/v3" + "context" + "fmt" + "github.com/fatih/color" + "github.com/urfave/cli/v3" + "log" + "os" ) func main() { EnsureBrewAvailable() - // declare CLI app - cmd := &cli.Command{ - Name: "wthis", - Usage: "Fetch information of a Homebrew formulae or cask, like how it got installed, reverse dependencies, etc.", - Action: func(ctx context.Context, cmd *cli.Command) error { - // check args - if cmd.Args().Len() == 0 { - printErrorAndExit("Please provide a formulae/cask name.") - } - pkgName := cmd.Args().First() - // prompt - showLoadingPrompt(fmt.Sprintf("What the heck is \"%s\"", pkgName)) - // search, tidy up, and print - formula, cask := GetBrewInfo(pkgName) - stat := NewStatistics(formula, cask, pkgName) - hideLoadingPrompt() - stat.Print() - return nil - }, - } + // declare CLI app + cmd := &cli.Command{ + Name: "wthis", + Usage: "Fetch information of a Homebrew formulae or cask, like how it got installed, reverse dependencies, etc.", + Action: func(ctx context.Context, cmd *cli.Command) error { + // check args + if cmd.Args().Len() == 0 { + printErrorAndExit("Please provide a formulae/cask name.") + } + pkgName := cmd.Args().First() + // prompt + showLoadingPrompt(fmt.Sprintf("What the heck is \"%s\"", pkgName)) + // search, tidy up, and print + formula, cask := GetBrewInfo(pkgName) + stat := NewStatistics(formula, cask, pkgName) + hideLoadingPrompt() + stat.Print() + return nil + }, + } - // run command and handle error - if err := cmd.Run(context.Background(), os.Args); err != nil { - log.Fatal(err) - } + // run command and handle error + if err := cmd.Run(context.Background(), os.Args); err != nil { + log.Fatal(err) + } } func printErrorAndExit(msg string) { -- cgit v1.2.3