lint: fix linting issues

This commit is contained in:
Romain Bertrand 2025-12-08 10:00:50 +01:00
parent 36891e06f4
commit 1d94431825
4 changed files with 12 additions and 14 deletions

View file

@ -27,7 +27,7 @@ func init() {
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.config/fgj/config.yaml)")
rootCmd.PersistentFlags().String("hostname", "", "Forgejo instance hostname")
viper.BindPFlag("hostname", rootCmd.PersistentFlags().Lookup("hostname"))
_ = viper.BindPFlag("hostname", rootCmd.PersistentFlags().Lookup("hostname"))
}
func initConfig() {
@ -41,7 +41,7 @@ func initConfig() {
}
configDir := home + "/.config/fgj"
os.MkdirAll(configDir, 0755)
_ = os.MkdirAll(configDir, 0755)
viper.AddConfigPath(configDir)
viper.SetConfigType("yaml")
@ -51,7 +51,5 @@ func initConfig() {
viper.AutomaticEnv()
viper.SetEnvPrefix("FGJ")
if err := viper.ReadInConfig(); err == nil {
// Config file found and successfully parsed
}
_ = viper.ReadInConfig()
}