Skip to content

Commit 45c7459

Browse files
authored
docs: Update docs (#91)
1 parent 48d7516 commit 45c7459

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
# getenv
99

10-
Package getenv provides functionality for loading environment variables and parse them into go builtin types.
10+
Package getenv provides a simple way to get environment variables.
11+
It's type-safe and supports built-in types and slices of them.
1112

1213
Types supported:
1314
- string
@@ -60,6 +61,7 @@ Types supported:
6061
EnvOrDefault retrieves the value of the environment variable named by the key.
6162
If the variable is present in the environment the value will be parsed and returned.
6263
Otherwise, the default value will be returned.
64+
The value returned will be of the same type as the default value.
6365

6466
```golang
6567
package main

getenv.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// Package getenv provides functionality for loading environment variables and parse them into go builtin types.
1+
// Package getenv provides a simple way to get environment variables.
2+
// It's type-safe and supports built-in types and slices of them.
23
//
34
// Types supported:
45
// - string
@@ -53,6 +54,7 @@ import (
5354
// EnvOrDefault retrieves the value of the environment variable named by the key.
5455
// If the variable is present in the environment the value will be parsed and returned.
5556
// Otherwise, the default value will be returned.
57+
// The value returned will be of the same type as the default value.
5658
func EnvOrDefault[T internal.EnvParsable](key string, defaultVal T, options ...option.Option) T {
5759
w := internal.NewEnvParser(defaultVal)
5860

0 commit comments

Comments
 (0)