diff --git a/server.go b/server.go index c4e05c3..5421720 100644 --- a/server.go +++ b/server.go @@ -91,8 +91,8 @@ func parseFlags() options { } func Listeners() []*net.TCPListener { - defer os.Unsetenv("LISTEN_PID") - defer os.Unsetenv("LISTEN_FDS") + defer unsetenv("LISTEN_PID") + defer unsetenv("LISTEN_FDS") pid, err := strconv.Atoi(os.Getenv("LISTEN_PID")) if err != nil || pid != os.Getpid() { diff --git a/unsetenv.go b/unsetenv.go new file mode 100644 index 0000000..0c89d5e --- /dev/null +++ b/unsetenv.go @@ -0,0 +1,9 @@ +// +build go1.4 + +package main + +import "os" + +func unsetenv(key string) { + os.Unsetenv(key) +} diff --git a/unsetenv_13.go b/unsetenv_13.go new file mode 100644 index 0000000..5245409 --- /dev/null +++ b/unsetenv_13.go @@ -0,0 +1,9 @@ +// +build !go1.4 + +package main + +import "os" + +func unsetenv(key string) { + os.Setenv(key, "") +}