Skip to content

Conversation

@bhavishyaone
Copy link
Contributor

Pull Request Template

Description:

  • Improved the error message displayed when running an invalid command in the GoFr CLI.
  • Addresses Issue Incorrect Error Message When Running Invalid Command in GoFr CLI #2611.
  • Motivation: The previous error message "No Command Found!" was misleading as it implied the application had no commands at all. The new message '<entered-command>' is not a valid command. provides clear feedback to the user about which specific command was not recognized, followed by the list of available commands. This improves the CLI user experience.

Breaking Changes (if applicable):

  • None. This change only updates the error message string for invalid commands.

Additional Information:

  • Modified pkg/gofr/cmd.go to include the invalid command name in the ErrCommandNotFound struct and formatted the error string.
  • Updated pkg/gofr/cmd_test.go to assert the new error message format in unit tests.

Checklist:

  • I have formatted my code using goimport and golangci-lint.
  • All new code is covered by unit tests.
  • This PR does not decrease the overall code coverage.
  • I have reviewed the code comments and documentation for clarity.

Thank you for your contribution!

Copy link
Member

@coolwednesday coolwednesday left a comment

Choose a reason for hiding this comment

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

Screenshot 2025-12-05 at 3 03 30 AM I ran the sample-cmd example in example folder. We do not actually have any support of `SetParam`. We also do not plan to add it. Please fix accordingly.

@coolwednesday coolwednesday dismissed their stale review December 5, 2025 12:20

I ahve fixed the required changes.

@coolwednesday coolwednesday merged commit a158a65 into gofr-dev:development Dec 5, 2025
16 checks passed
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.

3 participants