opentelemetry-collector
opentelemetry-collector copied to clipboard
[configoptional] Rename `hasValue` and `notNone`
Not something we have to decide here, and it's minor since it's largely internal, but how would you feel about calling this variable hasValue and renaming hasValue to hasSome?
- Makes it so that
hasValuemeans there's a default/explicitly-set value associated with an Optional object, throughDefault,Some, or unmarshaling. - Makes it so
hasSomemeans the Optional object has a value ready for use, throughSomeor unmarshaling. - The
Defaultfunction will no longer set a value while settinghasValue: false. - Gets rid of the negative in
notNonewhile keeping our preferred default as the zero value for the field.
My hope is that this would simplify, if only a bit, how we describe the state an Optional object is in. The downside is the name of the HasValue function wouldn't make as much sense anymore, and changing that would be breaking if we do it later, so we'd need to agree this is enough of an improvement to justify that. Also, "some" isn't necessarily a common concept, so perhaps working with "value" and "none" are better.
Originally posted by @evan-bradley in https://github.com/open-telemetry/opentelemetry-collector/pull/13168#discussion_r2135830187