From 99f0f31d3687da9f4f09280dd1b73aa6cb8c8bb4 Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Mon, 22 Jan 2024 13:15:46 -0500 Subject: [PATCH] doc: update README to document *bool behavior --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e8096b6..dbed28d 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ Initialize structs with default values - Scalar types - `int/8/16/32/64`, `uint/8/16/32/64`, `float32/64` - `uintptr`, `bool`, `string` + - `bool` values declared as a `*bool` allow for an unset boolean type. This helps distinguish the case where a default true bool is set to `false`. - Complex types - `map`, `slice`, `struct` - Nested types @@ -46,7 +47,7 @@ type Sample struct { Name string `default:"John Smith"` Age int `default:"27"` Gender Gender `default:"m"` - Working bool `default:"true"` + Working *bool `default:"true"` SliceInt []int `default:"[1, 2, 3]"` SlicePtr []*int `default:"[1, 2, 3]"`