Skip to content

Commit

Permalink
fix: #91 - add lock on binding values to struct
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Aug 9, 2022
1 parent 9764bbd commit 1ca5fff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions export.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ func (c *Config) Structure(key string, dst interface{}) error {
}
}

// add lock on binding values to struct
c.lock.RLock()
defer c.lock.RUnlock()

var bindConf *mapstructure.DecoderConfig
if c.opts.DecoderConfig == nil {
bindConf = newDefaultDecoderConfig()
Expand Down

0 comments on commit 1ca5fff

Please sign in to comment.