Skip to content

Commit

Permalink
Add note about concurrent Load()/*Get() access.
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh authored May 17, 2022
1 parent 4112a72 commit ab0a5ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ func main() {
### Watching files for changes
The `koanf.Provider` interface has a `Watch(cb)` method that asks a provider
to watch for changes and trigger the given callback that can live reload the
configuration.
configuration. This is not goroutine safe if there are concurrent `*Get()`
calls happening on the koanf object while it is doing a `Load()`. Such
scenarios will need mutex locking.

Currently, `file.Provider` supports this.

Expand Down

0 comments on commit ab0a5ac

Please sign in to comment.