If the configuration item of my ini configuration file contains #, it will cause an error in reading the configuration. · Issue #328 · go-ini/ini · GitHub
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
If the configuration item of my ini configuration file contains #, it will cause an error in reading the configuration. #328
If the configuration item of my ini configuration file contains #, it will cause the configuration to be read incorrectly. For example, my MySQL password is "xxx#123", and the obtained parameter is "xxx".
Fixed in v2 by #435, and will be in the next v2 pre-release after v2.0.0-beta.2. v2 is imported as unknwon.dev/ini/v2; see the migration guide for upgrading from v1.
Activity
Tensai75 commentedon Jan 30, 2023
I second that. This should really be addressed.
egorlepa commentedon Mar 1, 2023
same problem, can't have values with #
workaround:
chingzio commentedon Mar 1, 2023
I found a solution, you can use ` instead of " in the ini file, and you can read the configuration correctly.
for example:
[database]
DbPassWord = `XXX#123`
CodeMonkey80s commentedon Jan 12, 2024
You can also use triple quotes:
unknwon commentedon Nov 11, 2026
Fixed in v2 by #435, and will be in the next v2 pre-release after v2.0.0-beta.2. v2 is imported as
unknwon.dev/ini/v2; see the migration guide for upgrading from v1.