mirror of
https://github.com/m13253/dns-over-https.git
synced 2026-08-28 06:34:08 +00:00
Merge pull request #30 from Sherlock-Holo/master
Refine runtime.GOOS check, use switch case to replace a long if
This commit is contained in:
+2
-1
@@ -79,7 +79,8 @@ func main() {
|
|||||||
// process tracking. But I understand some cloud service providers have
|
// process tracking. But I understand some cloud service providers have
|
||||||
// their own monitoring system. So this feature is only enabled on Linux and
|
// their own monitoring system. So this feature is only enabled on Linux and
|
||||||
// BSD series platforms which lacks functionality similar to cgroup.
|
// BSD series platforms which lacks functionality similar to cgroup.
|
||||||
if runtime.GOOS == "dragonfly" || runtime.GOOS == "freebsd" || runtime.GOOS == "linux" || runtime.GOOS == "netbsd" || runtime.GOOS == "openbsd" {
|
switch runtime.GOOS {
|
||||||
|
case "dragonfly", "freebsd", "linux", "netbsd", "openbsd":
|
||||||
pidFile = flag.String("pid-file", "", "PID file for legacy supervision systems lacking support for reliable cgroup-based process tracking")
|
pidFile = flag.String("pid-file", "", "PID file for legacy supervision systems lacking support for reliable cgroup-based process tracking")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -79,7 +79,8 @@ func main() {
|
|||||||
// process tracking. But I understand some cloud service providers have
|
// process tracking. But I understand some cloud service providers have
|
||||||
// their own monitoring system. So this feature is only enabled on Linux and
|
// their own monitoring system. So this feature is only enabled on Linux and
|
||||||
// BSD series platforms which lacks functionality similar to cgroup.
|
// BSD series platforms which lacks functionality similar to cgroup.
|
||||||
if runtime.GOOS == "dragonfly" || runtime.GOOS == "freebsd" || runtime.GOOS == "linux" || runtime.GOOS == "netbsd" || runtime.GOOS == "openbsd" {
|
switch runtime.GOOS {
|
||||||
|
case "dragonfly", "freebsd", "linux", "netbsd", "openbsd":
|
||||||
pidFile = flag.String("pid-file", "", "PID file for legacy supervision systems lacking support for reliable cgroup-based process tracking")
|
pidFile = flag.String("pid-file", "", "PID file for legacy supervision systems lacking support for reliable cgroup-based process tracking")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user