3 ms·
You could almost shorten it to: if r, err := os.Open(src); err != nil { return err } defer r.Close() But then r is not in scope for the r.Close pro
by xarope 3y ago
You could almost shorten it to:
if r, err := os.Open(src); err != nil {
return err
}
defer r.Close()
But then r is not in scope for the r.Close proper