mirror of
https://github.com/anchore/syft.git
synced 2025-11-19 01:13:18 +01:00
* update build tags, ui support, and stereoscope, and release for windows support Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>
22 lines
327 B
Go
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
|
|
}
|