Closed
Description
package main
import (
"fmt"
"gopkg.in/gcfg.v1"
)
type Config struct {
Settings struct {
Enabled bool
}
}
func main() {
var config Config
err := gcfg.ReadStringInto(&config, "[Settings]\nEnabled = xxx\n")
fmt.Printf("read gave: %#v; %s\n", config, err)
}
$ go run parse.go
read gave: main.Config{Settings:struct { Enabled bool }{Enabled:false}}; failed to parse bool `xxx`
The error message should include information identifying the section and field that caused the error. In this case, maybe:
read gave: main.Config{Settings:struct { Enabled bool }{Enabled:false}}; failed to parse bool `xxx` into Settings.Enabled
Metadata
Metadata
Assignees
Labels
No labels