os: implement and smoketest os.Unsetenv

This commit is contained in:
Dan Kegel
2021-12-11 09:55:21 -08:00
committed by Ron Evans
parent cff4493ca0
commit e4f2b9c003
5 changed files with 64 additions and 2 deletions
+6 -2
View File
@@ -17,8 +17,12 @@ func Setenv(key, value string) error {
return nil
}
func Unsetenv(_ string) error {
return ErrNotImplemented
func Unsetenv(key string) error {
err := syscall.Unsetenv(key)
if err != nil {
return NewSyscallError("unsetenv", err)
}
return nil
}
func LookupEnv(key string) (string, bool) {