You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a real world we change our software sometimes, but is some cases - we would like to have an option to provide a smooth way to migrate from old options to a new one.
example:
// Old options that contains a logger
type Options struct {
logger *zap.Logger `option:"mandatory"`
}
// For example we would like to migrate from zap to slog. So we want to migrate to a new options struct like:
type Options struct {
logger *slog.Logger `option:""mandatory"`
}
Options:
We can just mark this logger field with // Deprecated: ... and create a new field. But in example above (when we have mandatory mark) we will not see a deprecation marker, because this field will have no setter like WithLogger.
???
The text was updated successfully, but these errors were encountered:
In a real world we change our software sometimes, but is some cases - we would like to have an option to provide a smooth way to migrate from old options to a new one.
example:
Options:
logger
field with// Deprecated: ...
and create a new field. But in example above (when we havemandatory
mark) we will not see a deprecation marker, because this field will have no setter likeWithLogger
.The text was updated successfully, but these errors were encountered: