Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions pkg/srvconn/sftp_asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -870,9 +870,6 @@ func (ad *SftpFileInfo) Size() int64 {
*/

func (ad *SftpFileInfo) Mode() os.FileMode {
if ad.isFromWebTerminal {
return ad.info.Mode()
}
if ad.isRoot && ad.info.IsDir() {
return ad.info.Mode() | os.ModePerm
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were no found differences or irregularities between the two versions of the provided code snippet. Both versions seem to be consistent with the context provided, and there is nothing that could potentially cause bugs or problems.

However, since I do not see any issues right away, it might be worth considering if you're dealing with real production code where every function may have its own unique set of requirements and constraints which need careful examination especially when compared over time.

Also consider that these files are from the last year but they should still follow the standard coding practices applicable today such as using Go's built-in os.ModeType which would align better than trying to manually define permissions this way even though the first version did not return os.FileMode. In addition, using os.ModeMask in conjunction with o.Syscall() rather than doing an explicit mode cast can yield cleaner looking errors like err != nil, instead of being limited to just "no error" conditions without knowing what went wrong precisely.

For instance,

return ret.Call("open", "/path/to/folder/path")

Would more clearly explain why open syscall failed because opening directories in Linux has different semantics than Windows due to the concept of a 'root' user.

Expand Down
Loading