mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-09 13:33:39 +00:00
os: implement and smoketest os.Setenv
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user