Skip to content

Commit

Permalink
add change log
Browse files Browse the repository at this point in the history
  • Loading branch information
ktong committed Nov 20, 2024
1 parent 31da552 commit cdb9243
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed

- Config.Load now is concurrent-safe (#567).

## [1.3.1] - 2024-09-09

### Added
Expand Down
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func New(opts ...Option) *Config {
// Load loads configuration from the given loader.
// Each loader takes precedence over the loaders before it.
//
// This method is concurrency-safe.
// This method is concurrent-safe.
func (c *Config) Load(loader Loader) error {
if loader == nil {
return nil
Expand Down
2 changes: 1 addition & 1 deletion default.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func Unmarshal(path string, target any) error {
// The register function must be non-blocking and usually completes instantly.
// If it requires a long time to complete, it should be executed in a separate goroutine.
//
// This method is concurrency-safe.
// This method is concurrent-safe.
func OnChange(onChange func(), paths ...string) {
defaultConfig.Load().OnChange(func(*Config) { onChange() }, paths...)
}
Expand Down
2 changes: 1 addition & 1 deletion watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (c *Config) Watch(ctx context.Context) error { //nolint:cyclop,funlen,gocog
// The register function must be non-blocking and usually completes instantly.
// If it requires a long time to complete, it should be executed in a separate goroutine.
//
// This method is concurrency-safe.
// This method is concurrent-safe.
func (c *Config) OnChange(onChange func(*Config), paths ...string) {
if onChange == nil {
return // Do nothing is onchange is nil.
Expand Down

0 comments on commit cdb9243

Please sign in to comment.