os: fix documentation for environ function (#24796)

This commit is contained in:
Laurent Cheylus 2025-06-26 18:25:02 +02:00 committed by GitHub
parent a5ece523e2
commit cf698066db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -81,14 +81,13 @@ pub fn unsetenv(name string) int {
}
}
// See: https://linux.die.net/man/5/environ for unix platforms.
// See: https://docs.microsoft.com/bg-bg/windows/win32/api/processenv/nf-processenv-getenvironmentstrings
// environ returns a map of all the current environment variables.
// See: https://linux.die.net/man/5/environ for Unix platforms.
// See: https://docs.microsoft.com/bg-bg/windows/win32/api/processenv/nf-processenv-getenvironmentstrings
// for Windows OS.
pub fn environ() map[string]string {
// TODO how to declare Virtual C globals?
// const C.environ &&char
pub fn environ() map[string]string {
mut res := map[string]string{}
$if windows {
mut estrings := C.GetEnvironmentStringsW()