From c65f27ffe69a43ae814a5e64c2fabb6c6312a4af Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 1 Oct 2014 12:10:37 -0700 Subject: [PATCH] go.sys: add Unsetenv LGTM=r R=r CC=golang-codereviews https://golang.org/cl/153810043 --- plan9/env_unset.go | 14 ++++++++++++++ unix/env_unset.go | 14 ++++++++++++++ windows/env_unset.go | 14 ++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 plan9/env_unset.go create mode 100644 unix/env_unset.go create mode 100644 windows/env_unset.go diff --git a/plan9/env_unset.go b/plan9/env_unset.go new file mode 100644 index 00000000..c37fc26e --- /dev/null +++ b/plan9/env_unset.go @@ -0,0 +1,14 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.4 + +package plan9 + +import "syscall" + +func Unsetenv(key string) error { + // This was added in Go 1.4. + return syscall.Unsetenv(key) +} diff --git a/unix/env_unset.go b/unix/env_unset.go new file mode 100644 index 00000000..92222625 --- /dev/null +++ b/unix/env_unset.go @@ -0,0 +1,14 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.4 + +package unix + +import "syscall" + +func Unsetenv(key string) error { + // This was added in Go 1.4. + return syscall.Unsetenv(key) +} diff --git a/windows/env_unset.go b/windows/env_unset.go new file mode 100644 index 00000000..999ffac4 --- /dev/null +++ b/windows/env_unset.go @@ -0,0 +1,14 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.4 + +package windows + +import "syscall" + +func Unsetenv(key string) error { + // This was added in Go 1.4. + return syscall.Unsetenv(key) +}