Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace flags usage with pflags #1270

Merged
merged 8 commits into from
Mar 31, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(?) test
  • Loading branch information
Dan Laine committed Mar 24, 2023
commit 0156743c5a01c3d7827bf16b80a80bd4efeb3d92
3 changes: 3 additions & 0 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"path/filepath"
"testing"

"github.com/spf13/pflag"
"github.com/spf13/viper"

"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -603,6 +604,8 @@ func setupFile(t *testing.T, path string, fileName string, value string) {
func setupViperFlags() *viper.Viper {
v := viper.New()
fs := BuildFlagSet()
pflag.CommandLine = pflag.NewFlagSet(os.Args[0], pflag.PanicOnError) // flags are now reset
pflag.Parse()
if err := v.BindPFlags(fs); err != nil {
log.Fatal(err)
}
Expand Down