Skip to content

Commit

Permalink
docs: document generics
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Apr 24, 2024
1 parent 4723331 commit b436dff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -56,6 +56,12 @@ func main() {
fmt.Printf("%+v\n", err)
}

// or you can use generics
cfg, err := env.ParseAs[config]()
if err != nil {
fmt.Printf("%+v\n", err)
}

fmt.Printf("%+v\n", cfg)
}
```
Expand Down

0 comments on commit b436dff

Please sign in to comment.