Version
1.67.0
Describe the bug
This code should gracefully fail with an error, panics instead
To reproduce
package main
import (
"log"
"gopkg.in/ini.v1"
)
type Config struct {
User string `ini:"user"`
Pass string `ini:"pass"`
}
const iniData = `
user = alice
pass = secret
`
func main() {
var cfg *Config
f, err := ini.Load([]byte(iniData))
if err != nil {
log.Fatal(err)
}
if err := f.MapTo(&cfg); err != nil {
log.Fatal(err)
}
log.Printf("User: %s, Pass: %s\n", cfg.User, cfg.Pass)
}
Expected behavior
Gracefully return an error
Code of Conduct
Version
1.67.0
Describe the bug
This code should gracefully fail with an error, panics instead
To reproduce
Expected behavior
Gracefully return an error
Code of Conduct