Skip to content

Commit

Permalink
NewOsFs: return an interface and not a pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
drakkan committed May 2, 2020
1 parent 3f75d46 commit b006c5f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Stream|Baseline MB/s|Devel MB/s|Optimized MB/s|Balanced MB/s|OpenSSH MB/s|
4|576|836|1080|1099|1569|
8|857|1161|1416|1433|2271|

#### Cipher aes128gcm@openssh.com
#### Cipher aes128-gcm@openssh.com

With this cipher the messages authentication is implicit, no SHA256 computation is needed.

Expand Down
3 changes: 1 addition & 2 deletions sftpd/sftpd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3862,8 +3862,7 @@ func TestResolveVirtualPaths(t *testing.T) {
MappedPath: mappedPath,
})
os.MkdirAll(mappedPath, 0777)
fs := vfs.NewOsFs("", user.GetHomeDir(), user.VirtualFolders)
osFs := fs.(*vfs.OsFs)
osFs := vfs.NewOsFs("", user.GetHomeDir(), user.VirtualFolders).(vfs.OsFs)
b, f := osFs.GetFsPaths("/vdir/a.txt")
if b != mappedPath {
t.Errorf("unexpected base path: %#v expected: %#v", b, mappedPath)
Expand Down
2 changes: 1 addition & 1 deletion vfs/osfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type OsFs struct {

// NewOsFs returns an OsFs object that allows to interact with local Os filesystem
func NewOsFs(connectionID, rootDir string, virtualFolders []VirtualFolder) Fs {
return &OsFs{
return OsFs{
name: osFsName,
connectionID: connectionID,
rootDir: rootDir,
Expand Down

0 comments on commit b006c5f

Please sign in to comment.