2014-08-12 01:48:46 +04:00
|
|
|
// Copyright 2010 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.
|
|
|
|
|
2014-08-13 04:00:33 +04:00
|
|
|
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
|
2014-08-12 01:48:46 +04:00
|
|
|
|
|
|
|
// Unix environment variables.
|
|
|
|
|
2014-08-12 02:58:26 +04:00
|
|
|
package unix
|
2014-08-12 01:48:46 +04:00
|
|
|
|
2014-08-13 20:00:28 +04:00
|
|
|
import "syscall"
|
2014-08-12 01:48:46 +04:00
|
|
|
|
|
|
|
func Getenv(key string) (value string, found bool) {
|
2014-08-13 20:00:28 +04:00
|
|
|
return syscall.Getenv(key)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
func Setenv(key, value string) error {
|
2014-08-13 20:00:28 +04:00
|
|
|
return syscall.Setenv(key, value)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
func Clearenv() {
|
2014-08-13 20:00:28 +04:00
|
|
|
syscall.Clearenv()
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
func Environ() []string {
|
2014-08-13 20:00:28 +04:00
|
|
|
return syscall.Environ()
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|