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

fix bug save value for ini config file #923

Closed
wants to merge 8 commits into from

Conversation

zhangyongding
Copy link

No description provided.

@CLAassistant
Copy link

CLAassistant commented Jun 2, 2020

CLA assistant check
All committers have signed the CLA.

@zhangyongding
Copy link
Author

#921

@sagikazarmark
Copy link
Collaborator

Can you please write a test demonstrating the faulty behavior?

@zhangyongding
Copy link
Author

package main

import (
	"fmt"

	"github.com/spf13/viper"
)

func main() {
	viper.SetConfigFile("config.ini")
	viper.AddConfigPath(".")
	viper.SetConfigType("ini")

	viper.Set("set.boolKey", true)
	viper.Set("set.intKey", 1)

	viper.WriteConfig()
	fmt.Println(viper.ConfigFileUsed())
}

@sagikazarmark
Copy link
Collaborator

I meant an automated test to the existing set of test suites.

@zhangyongding
Copy link
Author

Let me try

@sagikazarmark
Copy link
Collaborator

@zhangyongding can you add some tests here or probably in a separate test similar to toml proving the bug and that this patch fixes it?

Let me know if you need any help with it!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants