Skip to content

Commit

Permalink
Add IsSetByUser to config.Option
Browse files Browse the repository at this point in the history
dhaavi committed Jul 20, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 076ea97 commit 3f5345e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions config/option.go
Original file line number Diff line number Diff line change
@@ -310,6 +310,14 @@ func (option *Option) copyOrNil() *Option {
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.
func (option *Option) Export() (record.Record, error) {
option.Lock()

0 comments on commit 3f5345e

Please sign in to comment.