-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
env var API could be better #10953
Copy link
Copy link
Open
Labels
enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.standard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Milestone
Metadata
Metadata
Assignees
Labels
enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.standard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
std.os.getenvdoesn't work on Windows (see #10952) but I suspect it's what people will find first.You should probably be using
std.process.getEnvVarOwnedbut:zig/lib/std/child_process.zig
Lines 845 to 853 in a4df443
Solution
I'm not sure how to fix the naming issue, or if that is possible.
Perhaps we could change the function signature to not return an error for
EnvironmentVariableNotFoundthough? Then usage would be just:And
orelseusage would then just be:Thoughts?