mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-10 07:11:08 +00:00
a3c724f2c3
all: Add package runtimeos for runtime.GOOS comparisons I grew tired of hand written string comparisons. This adds generated constants for the GOOS values, and predefined Is$OS constants that can be iffed on. In a couple of places I rewrote trivial switch:es to if:s, and added Illumos where we checked for Solaris (because they are effectively the same, and if we're going to target one of them that would be Illumos...).
39 lines
936 B
Go
39 lines
936 B
Go
// Code generated by runtimeos.sh. DO NOT EDIT.
|
|
package build
|
|
|
|
import "runtime"
|
|
|
|
const (
|
|
AIX = "aix"
|
|
Android = "android"
|
|
Darwin = "darwin"
|
|
Dragonfly = "dragonfly"
|
|
FreeBSD = "freebsd"
|
|
Illumos = "illumos"
|
|
IOS = "ios"
|
|
JS = "js"
|
|
Linux = "linux"
|
|
NetBSD = "netbsd"
|
|
OpenBSD = "openbsd"
|
|
Plan9 = "plan9"
|
|
Solaris = "solaris"
|
|
Windows = "windows"
|
|
)
|
|
|
|
const (
|
|
IsAIX = runtime.GOOS == AIX
|
|
IsAndroid = runtime.GOOS == Android
|
|
IsDarwin = runtime.GOOS == Darwin
|
|
IsDragonfly = runtime.GOOS == Dragonfly
|
|
IsFreeBSD = runtime.GOOS == FreeBSD
|
|
IsIllumos = runtime.GOOS == Illumos
|
|
IsIOS = runtime.GOOS == IOS
|
|
IsJS = runtime.GOOS == JS
|
|
IsLinux = runtime.GOOS == Linux
|
|
IsNetBSD = runtime.GOOS == NetBSD
|
|
IsOpenBSD = runtime.GOOS == OpenBSD
|
|
IsPlan9 = runtime.GOOS == Plan9
|
|
IsSolaris = runtime.GOOS == Solaris
|
|
IsWindows = runtime.GOOS == Windows
|
|
)
|