mirror of https://github.com/pkg/sftp.git
OS specific syscall.Stat_t use into separate file
The use of Stat_t in request-example.go is unix specific and broke the Windows OS builds. This is the minimal change to fix that. This fixes #157.
This commit is contained in:
parent
2eb63db49d
commit
e1c86753b9
|
@ -11,7 +11,6 @@ import (
|
|||
"os"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
@ -187,7 +186,7 @@ func (f *memFile) Mode() os.FileMode {
|
|||
func (f *memFile) ModTime() time.Time { return f.modtime }
|
||||
func (f *memFile) IsDir() bool { return f.isdir }
|
||||
func (f *memFile) Sys() interface{} {
|
||||
return &syscall.Stat_t{Uid: 65534, Gid: 65534}
|
||||
return fakeFileInfoSys()
|
||||
}
|
||||
|
||||
// Read/Write
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
// +build !cgo,!plan9 windows android
|
||||
|
||||
package sftp
|
||||
|
||||
import "syscall"
|
||||
|
||||
func fakeFileInfoSys() interface{} {
|
||||
return &syscall.Stat_t{Uid: 65534, Gid: 65534}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
// +build darwin dragonfly freebsd !android,linux netbsd openbsd solaris
|
||||
// +build cgo
|
||||
|
||||
package sftp
|
||||
|
||||
import "syscall"
|
||||
|
||||
func fakeFileInfoSys() interface{} {
|
||||
return &syscall.Stat_t{Uid: 65534, Gid: 65534}
|
||||
}
|
Loading…
Reference in New Issue