Просмотр исходного кода

NewOsFs: return an interface and not a pointer

Nicola Murino 5 лет назад
Родитель
Сommit
b006c5f914
3 измененных файлов с 3 добавлено и 4 удалено
  1. 1 1
      docs/performance.md
  2. 1 2
      sftpd/sftpd_test.go
  3. 1 1
      vfs/osfs.go

+ 1 - 1
docs/performance.md

@@ -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 [email protected]
+#### Cipher aes128-[email protected]
 
 With this cipher the messages authentication is implicit, no SHA256 computation is needed.
 

+ 1 - 2
sftpd/sftpd_test.go

@@ -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)

+ 1 - 1
vfs/osfs.go

@@ -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,