Better OS checks

This commit is contained in:
AlexSSD7 2023-09-02 11:28:23 +01:00
commit 58039acc3c
9 changed files with 48 additions and 29 deletions

17
osspecifics/oschecks.go Normal file
View file

@ -0,0 +1,17 @@
package osspecifics
import "runtime"
// For some reason, `runtime` package does not provide this while
// "goconst" linter complains about us not using constants in
// expressions like `runtime.GOOS == "windows"`. And it is
// not wrong, accidentally mispelling these OS IDs is a
// matter of time.
func IsWindows() bool {
return runtime.GOOS == "windows"
}
func IsMacOS() bool {
return runtime.GOOS == "darwin"
}