Open
Description
Version
1.67.0
Describe the bug
I have some code that parses the output of an AWS command. I use:
cfg, err := ini.LoadSources(ini.LoadOptions{
InsensitiveSections: true,
IgnoreInlineComment: true,
SkipUnrecognizableLines: true, // Ignore the initial output pre-sections
}, output)
output is something like:
[profile Environment-Blah.PowerUserAccess]
sso_start_url = https://blah.awsapps.com/start#/
sso_region = us-east-1
sso_account_name = [Environment] Blah
sso_account_id = 111111
sso_role_name = PowerUserAccess
region = us-east-1
credential_process = aws-sso-util credential-process --profile blah
sso_auto_populated = true
Later when setting up certain profiles I do:
profileSection.Key("sso_start_url").SetValue(fmt.Sprintf("https://%s/start#/", envConfig.SSOStart))
When I save the .aws/config file however, I always get:
[profile blah-develop-admin]
sso_start_url = `'https://blah.awsapps.com/start#/'`
It will always wrap the output in because of the # in the url. No matter what I do, """ quoting, single quotes, double quotes, anything, it still wraps that entire value in
. It's as if this code from go-ini is ignored:
if strings.ContainsAny(val, "\n`") {
val = `"""` + val + `"""`
} else if !f.options.IgnoreInlineComment && strings.ContainsAny(val, "#;") {
val = "`" + val + "`"
I'd appreciate any ideas or help you could suggest, I cannot make this stop wrapping it in `. I did find a related bug, #282, but it seemed like the solution maybe worked for @5nafu.
To reproduce
.
Expected behavior
No `'s in the output.
Additional context
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
Activity