Defer-close the newly created config file (if does not exist)
This commit is contained in:
parent
c545b4071a
commit
7d2dd4652f
1 changed files with 3 additions and 0 deletions
|
|
@ -45,6 +45,7 @@ func LoadConfig() *Config {
|
|||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
c := Config{
|
||||
Mouse: true,
|
||||
|
|
@ -80,6 +81,8 @@ func LoadConfig() *Config {
|
|||
}
|
||||
|
||||
f.Sync()
|
||||
|
||||
return &c
|
||||
}
|
||||
|
||||
d, err := os.ReadFile(configPath)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue