Closed Happy-Ferret closed 4 years ago
Not really sure what you're hoping for here.
First of all, don't use wini. Use something like TOML.
Second of all, it's pretty much what you see is what you get: https://godoc.org/github.com/BurntSushi/wingo/wini
If you need examples, then look in the Wingo source code for how the wini package is being used.
My hope was to hook in my own (WIP) wallpaper application.
This was the basic code. I have no idea how to grab the value of "path" now.
func setWallpaper() {
tdata, err := wini.Parse(misc.ConfigFile("wallpaper.wini"))
if err != nil {
}
for _, section := range tdata.Sections() {
switch section {
case "global":
for _, key := range tdata.Keys(section) {
switch key.Name() {
case "path":
fmt.Println("Test")
}
}
}
}
That works! Thanks!
I'm trying to re-use the wini parser. However, I can't figure out how to quickly and efficiently parse a wini file without too much boilerplate.
How may I retrieve the value of
path
, given the followingwallpaper.wini
file?