浏览文件
request-unix.go
24 行 · 414 B历史下载| 1 | //go:build !windows && !plan9 |
| 2 | // +build !windows,!plan9 |
| 3 | |
| 4 | package sftp |
| 5 | |
| 6 | import ( |
| 7 | "errors" |
| 8 | "syscall" |
| 9 | ) |
| 10 | |
| 11 | func fakeFileInfoSys() any { |
| 12 | return &syscall.Stat_t{Uid: 65534, Gid: 65534} |
| 13 | } |
| 14 | |
| 15 | func testOsSys(sys any) error { |
| 16 | fstat := sys.(*FileStat) |
| 17 | if fstat.UID != uint32(65534) { |
| 18 | return errors.New("Uid failed to match") |
| 19 | } |
| 20 | if fstat.GID != uint32(65534) { |
| 21 | return errors.New("Gid failed to match") |
| 22 | } |
| 23 | return nil |
| 24 | } |

