File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -33,21 +33,25 @@ Given you have a `.env` file somewhere like this
3333# COMMENT will not be parsed
3434name =Me
3535age =420
36- male =true
36+ male =
3737pi =3.14
3838```
3939
40+ > [ !NOTE]
41+ > Keys can have empty values. in that case, the default value of the struct will be used
42+
4043> [ !NOTE]
4144> The keys are case insensitive, so you could have a key ` NICK_NAME ` in your env file
4245> This will then map to field ` nick_name ` in your struct
4346
47+
4448Now, you can simply use it as is shown in the example below:
4549
4650``` zig
4751const std = @import("std");
4852const zenvars = @import("zenvars");
4953
50- // Default values are necessary as of now
54+ // Default values are necessary
5155pub const EnvVars = struct {
5256 name: []const u8 = "none",
5357 age: i32 = 0,
You can’t perform that action at this time.
0 commit comments