Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to mark options as deprecated #47

Open
kazhuravlev opened this issue Jun 24, 2023 · 0 comments
Open

Provide a way to mark options as deprecated #47

kazhuravlev opened this issue Jun 24, 2023 · 0 comments

Comments

@kazhuravlev
Copy link
Owner

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.
  • ???
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant