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

Add the warning for Options fields that published #27

Closed
1 of 3 tasks
kazhuravlev opened this issue Aug 31, 2022 · 2 comments · Fixed by #37
Closed
1 of 3 tasks

Add the warning for Options fields that published #27

kazhuravlev opened this issue Aug 31, 2022 · 2 comments · Fixed by #37
Assignees
Labels
good first issue Good for newcomers

Comments

@kazhuravlev
Copy link
Owner

kazhuravlev commented Aug 31, 2022

options-gen should print the warning about field S3Endpoint (because ayone can change this option without constructor) in that case:

type Options struct {
  S3Endpoint string `option:"mandatory"`
}
  • Print warning about public field in Options struct.
  • Allow to disable warning by specify an argument like //go:generate options-gen .... --mute-warnings. By default it is enabled.
  • Previous flag should disable warnings about deprecated option flags (required, not-empty).
@kazhuravlev kazhuravlev added the good first issue Good for newcomers label Aug 31, 2022
@Antonboom
Copy link
Contributor

Maybe by default to issue not a warning, but an error?
Thus to work like a linter.

@kazhuravlev
Copy link
Owner Author

@Antonboom It sounds interesting, but I will create a separate issue for this idea. I will add it in the next major version. This will break compatibility right now.

kazhuravlev added a commit that referenced this issue Oct 2, 2022
# Conflicts:
#	examples/library/main.go
kazhuravlev added a commit that referenced this issue Oct 2, 2022
Added the warning for Options fields that were published
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants