Skip to content

Commit 3baf290

Browse files
committed
Updated for specific case for wasm
1 parent cad3244 commit 3baf290

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

file/file_other.go

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
1-
//go:build !windows && !darwin && !dragonfly && !freebsd && !linux && !nacl && !netbsd && !openbsd && !solaris
1+
//go:build !windows && !darwin && !dragonfly && !freebsd && !linux && !nacl && !netbsd && !openbsd && !solaris && !wasm
22

33
package file
44

55
import (
66
"os"
7-
"syscall"
87
)
98

10-
func getOSFileInfo(info os.FileInfo) *FileInfo {
11-
fi := &FileInfo{}
12-
if s, ok := info.Sys().(*syscall.Stat_t); ok {
13-
fi.Nlink = uint32(s.Nlink)
14-
fi.UID = s.Uid
15-
fi.GID = s.Gid
16-
fi.Fileid = s.Ino
17-
return fi
18-
}
9+
func getOSFileInfo(_ os.FileInfo) *FileInfo {
1910
return nil
2011
}

file/file_wasm.go

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//go:build wasm
2+
3+
package file
4+
5+
import (
6+
"os"
7+
"syscall"
8+
)
9+
10+
func getOSFileInfo(info os.FileInfo) *FileInfo {
11+
fi := &FileInfo{}
12+
if s, ok := info.Sys().(*syscall.Stat_t); ok {
13+
fi.Nlink = uint32(s.Nlink)
14+
fi.UID = s.Uid
15+
fi.GID = s.Gid
16+
fi.Fileid = s.Ino
17+
return fi
18+
}
19+
return nil
20+
}

0 commit comments

Comments
 (0)