From a43f8fc6467b3b4e40f651cd312d33e7da5f2477 Mon Sep 17 00:00:00 2001 From: lvlcn-t <75443136+lvlcn-t@users.noreply.github.com> Date: Thu, 24 Oct 2024 20:20:14 +0200 Subject: [PATCH] chore(env): adjust simple example Signed-off-by: lvlcn-t <75443136+lvlcn-t@users.noreply.github.com> --- example/env/simple/app.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/example/env/simple/app.go b/example/env/simple/app.go index 7e5f5cb..11d596a 100644 --- a/example/env/simple/app.go +++ b/example/env/simple/app.go @@ -20,10 +20,11 @@ func main() { fmt.Println(env.MustGet[int]("MY_INT")) fmt.Println(env.MustGet("MY_DURATION", time.ParseDuration)) - // Read a couple of environment variables that are necessary but you want to handle the errors gracefully. + // Read an environment variable that is necessary but you want to handle the error gracefully. value, err := env.Get[bool]("MY_BOOL").NoFallback().Value() if err != nil { fmt.Println("Failed to get MY_BOOL:", err) + return } fmt.Println(value) }