We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have the following code
import "gopkg.in/ini.v1" type AccessKey struct { AccessKeyId string `ini:"access_key_id"` AccessKeySecret string `ini:"access_key_secret"` } type User struct { Root AccessKey `ini:"User"` Default AccessKey `ini:"User"` Name string `ini:"name"` } type Section struct { User User } func main() { cfg, err := ini.Load("credential") if err != nil { panic(err) } s1 := Section{ User: User{ Root: AccessKey{ AccessKeyId: "privkey", AccessKeySecret: "privsecret", }, Default: AccessKey{ AccessKeyId: "key1", AccessKeySecret: "secret1", }, Name: "Ramesh", }, } if err = cfg.ReflectFrom(&s1); err != nil { panic(err) } if err = cfg.SaveTo("user.ini"); err != nil { panic(err) } }
Which produces the following output
[User] access_key_id = key1 access_key_secret = secret1 name = Ramesh
Is it possible to add functionality such that
if a prefix is attached to a struct type then all keys of the struct type would have the prefix
type User struct { Root AccessKey `ini:"User" prefix:"root"` Default AccessKey `ini:"User" prefix:""` Name string `ini:"name"` }
So that the output look like this
[User] access_key_id = key1 access_key_secret = secret1 root_access_key_id = privkey root_access_key_secret = privsecret name = Ramesh
I have none if you could suggest one that might work it will be great.
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the feature
I have the following code
Which produces the following output
Describe the solution you'd like
Is it possible to add functionality such that
if a prefix is attached to a struct type then all keys of the struct type would have the prefix
So that the output look like this
Describe alternatives you've considered
I have none if you could suggest one that might work it will be great.
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: