Skip to content

Commit d3fafea

Browse files
committed
os.Unsetenv is available since go 1.4
1 parent 2d21675 commit d3fafea

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)