add release for freebsd

This commit is contained in:
v2ray committed 2016-07-27 16:56:32 +02:00
1 parent b7ff8b8e4c
commit 330abd126c
3 files changed
+17 -1

No files matched your search

+13 -1
View File
@@ -10,6 +10,7 @@ const (
Windows = GoOS("windows")
MacOS = GoOS("darwin")
Linux = GoOS("linux")
FreeBSD = GoOS("freebsd")
UnknownOS = GoOS("unknown")
)
@@ -35,6 +36,9 @@ func parseOS(rawOS string) GoOS {
if osStr == "linux" || osStr == "debian" || osStr == "ubuntu" || osStr == "redhat" || osStr == "centos" {
return Linux
}
if osStr == "freebsd" {
return FreeBSD
}
return UnknownOS
}
@@ -83,7 +87,15 @@ func getSuffix(os GoOS, arch GoArch) string {
case Mips64:
suffix = "-linux-mips64"
}
case FreeBSD:
switch arch {
case X86:
suffix = "-freebsd-32"
case Amd64:
suffix = "-freebsd-64"
case Arm:
suffix = "-freebsd-arm"
}
}
return suffix
}