Skip to content

Commit

Permalink
Fix the lint issues
Browse files Browse the repository at this point in the history
1. fix errcheck in main.go - check return value of `viper.BindPFlags`
2. fix v in config.go - added nolint to config.go to escape from lint issues as it contains unused variables. This file can even be removed from repo if not needed
  • Loading branch information
ramya-bangera committed Oct 17, 2024
1 parent 5d974f1 commit 0891ef0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/migrate/config.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:unused
package main

import "github.com/spf13/pflag"
Expand Down
5 changes: 4 additions & 1 deletion cmd/migrate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ import (

func init() {
pflag.Parse()
viper.BindPFlags(pflag.CommandLine)
err := viper.BindPFlags(pflag.CommandLine)
if err != nil {
log.Fatalf("failed to bind full flag set to config: %v", err)
}
viper.AutomaticEnv()
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
viper.AddConfigPath(viper.GetString("config.source"))
Expand Down

0 comments on commit 0891ef0

Please sign in to comment.