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

Update code comments, improve formatting, and adjust Dockerfile #214

Closed
wants to merge 2 commits into from

Conversation

paskal
Copy link
Collaborator

@paskal paskal commented Jan 6, 2025

  • Simplify and clarify comments in approved_users.go
  • Fix formatting and spacing in admin.go and detector.go
  • Update Dockerfile to use Alpine 3.21 and improve readability
  • Add var/ and logs/ to .dockerignore and .gitignore
  • Fix typo in README.md
  • Improve error handling in main.go
  • Enhance test formatting in webapi_test.go
  • Clean up code structure and remove unused imports

@paskal paskal requested a review from umputun as a code owner January 6, 2025 01:24
Copy link

cloudflare-workers-and-pages bot commented Jan 6, 2025

Deploying tg-spam with  Cloudflare Pages  Cloudflare Pages

Latest commit: 223fcf7
Status: ✅  Deploy successful!
Preview URL: https://93217775.tg-spam.pages.dev
Branch Preview URL: https://paskal-small-fixes.tg-spam.pages.dev

View logs

@paskal paskal force-pushed the paskal/small-fixes branch from b048a87 to e0975fc Compare January 6, 2025 01:27
app/main.go Outdated
@@ -149,7 +149,7 @@ func main() {
p := flags.NewParser(&opts, flags.PrintErrors|flags.PassDoubleDash|flags.HelpFlag)
p.SubcommandsOptional = true
if _, err := p.Parse(); err != nil {
if err.(*flags.Error).Type != flags.ErrHelp {
if !errors.Is(err.(*flags.Error).Type, flags.ErrHelp) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now when it's extracted I see that this is actually wrong, error.Is should be comparing plain err and not err.Type.

paskal added 2 commits January 6, 2025 01:39

Verified

This commit was signed with the committer’s verified signature.
paskal Dmitry V
- Simplify and clarify comments in approved_users.go
- Fix formatting and spacing in admin.go and detector.go
- Update Dockerfile to use Alpine 3.21 and improve readability
- Add var/ and logs/ to .dockerignore and .gitignore
- Fix typo in README.md
- Improve error handling in main.go
- Enhance test formatting in webapi_test.go
- Clean up code structure and remove unused imports

Verified

This commit was signed with the committer’s verified signature.
paskal Dmitry V
Remove unnecessary type assertion when checking for help flag error, as
errors.Is() can directly compare the error types.
@paskal paskal force-pushed the paskal/small-fixes branch from e0975fc to 223fcf7 Compare January 6, 2025 01:40
@paskal paskal closed this Jan 6, 2025
@paskal paskal deleted the paskal/small-fixes branch January 6, 2025 01:53
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

Successfully merging this pull request may close these issues.

None yet

1 participant