prometheus / procfs

procfs provides functions to retrieve system, kernel and process metrics from the pseudo-filesystem proc.
Apache License 2.0
769 stars 319 forks source link

fs: syscall.Statfs_t object doesn't have a Type field on Windows #528

Closed adrianosela closed 1 year ago

adrianosela commented 1 year ago

fs: syscall.Statfs_t object doesn't have a Type field on Windows

Fixes build for GOOS=windows (https://github.com/prometheus/procfs/issues/527)

This PR extends the solution from https://github.com/prometheus/procfs/pull/523 to include windows in the list of OSes for which the syscall.Statfs_t object does not have a Type field

Testing:

Before:

✔ ~/go/src/github.com/adrianosela/procfs [master|✔]
11:22 $ GOOS=windows GOARCH=amd64 go build
# github.com/prometheus/procfs
./fs_statfs_type.go:25:18: undefined: syscall.Statfs_t
./fs_statfs_type.go:26:17: undefined: syscall.Statfs

After:

✔ ~/go/src/github.com/adrianosela/procfs [master|✔]
11:24 $ GOOS=windows GOARCH=amd64 go build
✔ ~/go/src/github.com/adrianosela/procfs [master|✔]
adrianosela commented 1 year ago

Cross posting from: https://github.com/prometheus/procfs/pull/529

Hey @SuperQ , would be good to go over the list here https://github.com/golang/go/blob/master/src/go/build/syslist.go and deal with all of the OSes.... there's a list of unix-like OSses there too, so maybe worth just going off of that?