mirror of
https://github.com/taigrr/golang-wpasupplicant
synced 2025-01-18 04:43:18 -08:00
Return err instead of panic when creating temp file fails
This commit is contained in:
parent
853de1e237
commit
f41eb91a51
@ -73,7 +73,7 @@ func Unixgram(ifName string) (Conn, error) {
|
|||||||
|
|
||||||
local, err := ioutil.TempFile("/tmp", "wpa_supplicant")
|
local, err := ioutil.TempFile("/tmp", "wpa_supplicant")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
return nil, err
|
||||||
}
|
}
|
||||||
os.Remove(local.Name())
|
os.Remove(local.Name())
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user