mirror of
https://github.com/onyx-and-iris/gogn.git
synced 2026-04-16 14:23:35 +00:00
lint fixes
This commit is contained in:
22
main.go
22
main.go
@@ -4,6 +4,7 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
@@ -42,15 +43,28 @@ func init() {
|
||||
viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))
|
||||
viper.SetEnvPrefix("GOGN")
|
||||
viper.AutomaticEnv()
|
||||
viper.BindPFlag("height", rootCmd.PersistentFlags().Lookup("height"))
|
||||
viper.BindPFlag("filter", rootCmd.PersistentFlags().Lookup("filter"))
|
||||
viper.BindPFlag("start-search", rootCmd.PersistentFlags().Lookup("start-search"))
|
||||
if err := viper.BindPFlag("height", rootCmd.PersistentFlags().Lookup("height")); err != nil {
|
||||
log.Fatal("error binding height flag: %w", err)
|
||||
}
|
||||
if err := viper.BindPFlag("filter", rootCmd.PersistentFlags().Lookup("filter")); err != nil {
|
||||
log.Fatal("error binding filter flag: %w", err)
|
||||
}
|
||||
if err := viper.BindPFlag(
|
||||
"start-search",
|
||||
rootCmd.PersistentFlags().Lookup("start-search"),
|
||||
); err != nil {
|
||||
log.Fatal("error binding start-search flag: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
// main is the entry point of the application.
|
||||
// It executes the root command and handles any errors.
|
||||
func main() {
|
||||
if err := fang.Execute(context.Background(), rootCmd, fang.WithVersion(versionFromBuild())); err != nil {
|
||||
if err := fang.Execute(
|
||||
context.Background(),
|
||||
rootCmd,
|
||||
fang.WithVersion(versionFromBuild()),
|
||||
); err != nil {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user