syft/syft/source/file_details.go
Christopher Angelo Phillips 10fa8dc7c9
Add windows support (#548)
* update  build tags, ui support, and stereoscope, and release for windows support

Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>
2021-10-21 12:49:36 -04:00

22 lines
327 B
Go

//go:build linux || darwin
// +build linux darwin
package source
import (
"os"
"syscall"
)
// GetXid is the UID GID system info for unix
func GetXid(info os.FileInfo) (uid, gid int) {
uid = -1
gid = -1
if stat, ok := info.Sys().(*syscall.Stat_t); ok {
uid = int(stat.Uid)
gid = int(stat.Gid)
}
return uid, gid
}