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
If key name is - in data source, then it would be seen as special syntax for auto-increment key name start from 1, and every section is independent on counter.
I want to add a key value to the auto increment key name.
To reproduce
package main
import (
"gopkg.in/ini.v1""log"
)
funcmain() {
cfgs, err:=ini.Load([]byte(`[features] -: Support read/write comments of keys and sections -: Support auto-increment of key names -: Support load multiple files to overwrite key values`))
iferr!=nil {
log.Fatalf("Error: %s", err.Error())
}
newkey, _:=cfgs.Section("features").NewKey("-", "dasda")
keys:=cfgs.Section("features").KeyStrings()
log.Println(newkey)
log.Println(keys)
// [#1 #2 #3 -]
}
But I print the added keys and get a key value other than #4, but -
Expected behavior
I want to get a key value like #4, but -
Additional context
No response
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Version
1.67.0
Describe the bug
If key name is - in data source, then it would be seen as special syntax for auto-increment key name start from 1, and every section is independent on counter.
I want to add a key value to the auto increment key name.
To reproduce
But I print the added keys and get a key value other than
#4
, but-
Expected behavior
I want to get a key value like
#4
, but-
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: