mirror of
https://github.com/safing/portbase
synced 2025-09-01 18:19:57 +00:00
Add IsSetByUser to config.Option
This commit is contained in:
parent
076ea970af
commit
3f5345e674
1 changed files with 8 additions and 0 deletions
|
@ -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()
|
||||||
|
|
Loading…
Add table
Reference in a new issue