os: implement and smoketest os.Setenv

This commit is contained in:
Dan Kegel
2021-12-05 13:24:00 -08:00
committed by Ron Evans
parent 93ac7cec0d
commit cff4493ca0
5 changed files with 96 additions and 0 deletions
+12
View File
@@ -9,6 +9,18 @@ func Getenv(key string) string {
return v
}
func Setenv(key, value string) error {
err := syscall.Setenv(key, value)
if err != nil {
return NewSyscallError("setenv", err)
}
return nil
}
func Unsetenv(_ string) error {
return ErrNotImplemented
}
func LookupEnv(key string) (string, bool) {
return syscall.Getenv(key)
}