Skip to content

Commit d81d57f

Browse files
committed
Clarified empty values in readme
1 parent 4f6fa4d commit d81d57f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,25 @@ Given you have a `.env` file somewhere like this
3333
# COMMENT will not be parsed
3434
name=Me
3535
age=420
36-
male=true
36+
male=
3737
pi=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+
4448
Now, you can simply use it as is shown in the example below:
4549

4650
```zig
4751
const std = @import("std");
4852
const zenvars = @import("zenvars");
4953
50-
// Default values are necessary as of now
54+
// Default values are necessary
5155
pub const EnvVars = struct {
5256
name: []const u8 = "none",
5357
age: i32 = 0,

0 commit comments

Comments
 (0)