-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
submit an issue for toml package to reset slices instead of always adding to them (for slice fields, e.g., FavPaths) #803
Comments
toml only adds to existing apparently. added a reset in SystemSettings Open method. d54055a |
Not a working solution. This removes all support for default fav paths, so, for example, I now have no fav paths. |
Given that the fav paths seem to get reset correctly after you restart the app, it doesn't seem like a toml loading problem. |
Is it possible that something is going wrong with the SetToDefaults method? Have you checked whether DefaultPaths is somehow getting modified? |
I pushed a soln: if empty after loading, set to defaults. it is definitely just adding in toml -- I'm pretty sure I had this problem in other cases too... could do more research about that, but this should be workin gnow |
I added a unit test to tomls: it is definitely not just adding: see 288f7e9. |
it only is a problem for []struct not []string -- check out the updated test that shows the problem. |
they have different save formats -- struct is separate [[Slice]] elements and it is clear from the format that it would have a hard time knowing when to reset. |
Should we file this as an issue upstream? |
no I think it is intrinsic to the format. |
Regardless of how difficult it would be to fix, this is a violation of the standard go marshalling and umarshalling paradigm that people would expect, so there should at least be a disclaimer upstream. |
it would have to have some kind of global var during outer loop of loading to detect when the first of each such slice element was encountered, and reset then. or just reset at the start. you could google about this further though. anyway, do you want to make the test pass or should i? |
I filed the issue (pelletier/go-toml#931). |
The issue has been resolved (see pelletier/go-toml#934 and 17911aa). |
maybe when you change a setting? not clear.
The text was updated successfully, but these errors were encountered: