-
Notifications
You must be signed in to change notification settings - Fork 382
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working