Skip to content

Commit 53e8175

Browse files
committed
Merge pull request #79 from vially/unsetenv
os.Unsetenv is now available (added in go 1.4)
2 parents b5a19de + d3fafea commit 53e8175

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

activation/files.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ const (
2828

2929
func Files(unsetEnv bool) []*os.File {
3030
if unsetEnv {
31-
// there is no way to unset env in golang os package for now
32-
// https://code.google.com/p/go/issues/detail?id=6423
33-
defer os.Setenv("LISTEN_PID", "")
34-
defer os.Setenv("LISTEN_FDS", "")
31+
defer os.Unsetenv("LISTEN_PID")
32+
defer os.Unsetenv("LISTEN_FDS")
3533
}
3634

3735
pid, err := strconv.Atoi(os.Getenv("LISTEN_PID"))

0 commit comments

Comments
 (0)