viper.Set Not Working, Race Condition? #1211
Unanswered
helloworldless
asked this question in
Q&A
Replies: 1 comment
-
Ok, found this in the test that's not working: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It's not a great design, but I have a test where I'm doing
viper.Set("abc", "def")
to set a property. Then, in the code I'm testing, it's reading that same key:viper.GetString("abc")
. Now the problem is that the value in the code under testing is always""
.Is there a race condition? is there another way to do this?
I'm pretty new to Go, so not sure what's going on here!
Update:
In some tests, it seems to consistently work:
In others, it consistently does not:
Beta Was this translation helpful? Give feedback.
All reactions