Skip to content

Commit

Permalink
remove unnecessary block, and explain why the one added is necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
puellanivis committed Feb 6, 2024
1 parent 6c7c0da commit e808920
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ func (c *Client) Lstat(p string) (os.FileInfo, error) {
}
attr, _, err := unmarshalAttrs(data)
if err != nil {
// avoid returning a valid value from fileInfoFromStats if err != nil.
return nil, err
}
return fileInfoFromStat(attr, path.Base(p)), nil
Expand Down Expand Up @@ -667,9 +668,6 @@ func (c *Client) stat(path string) (*FileStat, error) {
return nil, &unexpectedIDErr{id, sid}
}
attr, _, err := unmarshalAttrs(data)
if err != nil {
return nil, err
}
return attr, err
case sshFxpStatus:
return nil, normaliseError(unmarshalStatus(id, data))
Expand Down

0 comments on commit e808920

Please sign in to comment.