Add IsSetByUser to config.Option

This commit is contained in:
Daniel 2023-07-20 14:53:23 +02:00
parent 076ea970af
commit 3f5345e674

View file

@ -310,6 +310,14 @@ func (option *Option) copyOrNil() *Option {
return copied.(*Option) //nolint:forcetypeassert return copied.(*Option) //nolint:forcetypeassert
} }
// IsSetByUser returns whether the option has been set by the user.
func (option *Option) IsSetByUser() bool {
option.Lock()
defer option.Unlock()
return option.activeValue != nil
}
// Export expors an option to a Record. // Export expors an option to a Record.
func (option *Option) Export() (record.Record, error) { func (option *Option) Export() (record.Record, error) {
option.Lock() option.Lock()