Skip to content

Commit

Permalink
refactor: simplify conditional check for template validity in root co…
Browse files Browse the repository at this point in the history
…mmand
  • Loading branch information
jasonuc committed Dec 14, 2024
1 parent 4986dee commit 25e2c6f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Visit https://github.com/jasonuc/greentext for more information.`,
Run: func(cmd *cobra.Command, args []string) {
defaultTemplate, ok := cmd.Context().Value(defaultTemplateKey).([]byte)

if ok != true {
if !ok {
fmt.Println("Invalid template passed")
return
}
Expand Down Expand Up @@ -128,8 +128,6 @@ Visit https://github.com/jasonuc/greentext for more information.`,
},
}

// Execute adds all child commands to the root command and sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute(currentVersion string, defaultTemplate []byte) error {
rootCmd.Version = currentVersion
info := version.FetchUpdateInfo(rootCmd.Version)
Expand Down

0 comments on commit 25e2c6f

Please # to comment.