Skip to content

Updates the example for a Parsley-enabled app #3137

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

matzefriedrich
Copy link
Contributor

@matzefriedrich matzefriedrich commented May 19, 2025

This PR contains an update for the parsley recipe.

Changes

  • Updates the sample application; uses the latest release of the matzefriedrich/parsley package
  • Improves the recipe README file - adds a step-by-step guide for the example to make the recipe more accessible when viewed via the GoFiber Docs site

Summary by CodeRabbit

  • Documentation
    • Expanded and restructured the README with detailed step-by-step instructions, code examples, and improved explanations for integrating Parsley with GoFiber.

Copy link
Contributor

coderabbitai bot commented May 19, 2025

## Walkthrough

The Parsley example's README was extensively expanded and restructured into a detailed tutorial with prerequisites, overview, stepwise instructions, and comprehensive code examples. Additionally, import paths in source files were updated to fully qualified module paths, and minor formatting improvements were made. No public APIs or exported entities were changed.

## Changes

| File(s)                                             | Change Summary                                                                                                                         |
|----------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|
| parsley/README.md                                  | Expanded and restructured into a detailed tutorial with prerequisites, overview, step-by-step instructions, and example usage commands. |
| parsley/cmd/main.go                                | Updated import paths to fully qualified module paths; renamed context variable to `ctx` to avoid shadowing; no logic changes.           |
| parsley/internal/application.go                    | Updated import path for `route_handlers` to fully qualified module path; no logic changes.                                             |
| parsley/internal/modules/greeter_module.go         | Updated import path for `services` to fully qualified module path; no logic changes.                                                   |
| parsley/internal/modules/route_handlers_module.go  | Updated import path for `route_handlers` to fully qualified module path; no logic changes.                                             |
| parsley/internal/route_handlers/greeter.go          | Updated import path for `services` to fully qualified module path; added a blank line at start of method body; no logic changes.        |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant Client
    participant FiberApp
    participant GreeterService

    Client->>FiberApp: HTTP GET /say-hello?polite=true
    FiberApp->>GreeterService: Call Greet(polite)
    GreeterService-->>FiberApp: Returns greeting string
    FiberApp-->>Client: Respond with greeting

Possibly related PRs

Suggested reviewers

  • ReneWerner87

Poem

In a README garden, seeds were sown,
With stepwise guides, the details grown.
Imports aligned, a clearer way,
A blank line hops to brighten the day.
Now bunnies code with clearer sight,
And every hop just feels more right! 🥕


<!-- walkthrough_end -->
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNxU3bABsvkCiQBHbGlcABpIcVwvOkgAIgBVblpqaQjYEkgSAA80Zm5oyAAzfD40a2dEaNkwMhVo+jRublDYyAB3NGQHAWZ1Gno5NIzsREpIZmoALxJCing6OYZYdGRbSAxHATGAZgBGbYB2fixcdMgAcXwAMXgtvn8GeG5U/258RHUS2Q0YM6XMUjIYoMEbHIaQAAG3AqVQhflETxIPwAys9HoV4Aw0D5ZOFTsMkikUBgGF5sEpkGV/BIkPB8Fh8IVwYhcvkMo18pjqHSTvhIHh4F54NNwV4UohcPDop0MozwRCJrhprN5rRFrAAPTQiiVEiyOHQhgAazQpB+AEFaLR1DzsV5ceCHoiAOTIGwAUXNABEALLuoqCjKwTqQLZkFB5Cj4KQDeRoK3wDBEdD2GjcMByMASkjcSBEbDwJRFErg7Ks6I/dzIMjBkkkNgYSXaZjIAjjNBGjL4+GPZ7jErshgMaQfAQFTD0EideZ8NvFHz4NrtdJYGkkNoxU5R7BEZbdy43O6QL34BhddRI34ZNZYrBbeFrjf0ROQJS4bS+ajg+I2AAyXFgXBcG4RAOA1DUiHUWBsAEDQmGYCDGVuSgNSdZ5EC1bwvA1PZDg0Ix9GMcAoDIeg5TQPBCFIcgqH6BRWHYLheH4YRRHEKQZHkJglCoVR1C0HRCJMKAqxQSksAoghiDIZQ6PghtOD8NAlwcJwXFDLjFGUPjNG0XQwEMIjTAMbVdVkDUPW9P0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T9haBtgBAKTaB2S9ofEBBBSDhCgGAOSyT2S5ZaAhwSADTDhuTOTZS9p5S0SIBIBtg9pVABTlSDoXT2SKTChuS1SSAySDSySOTBTdgBAyTuTChdgKS9oBSDhZSjghJ0SRSYz2TuTdgDh2T2SXTBSKSszaAyTCg9peTGSSAYzwy0BGTXTDS6AGAEyHSgTtgoyAyVSSBuTMzBSBADgDhozthsptTyTizCh1T2Tdg5YKSySGBGSyTGTBSGzkzChCy5YGAtg0AczGTuT0zdhpzLSKTSyGA5ZBTBSZzaAGT2SSBthGSygkynSdSyTdhaAuypTYyKSGBuTBTOT1TgzRzwylA0ADh2yDpqT2Tjy1z5ynSSAsyBBjSGBzyLy9pGSmT2S2TthJSDhpS0BdgIy1SHzdhOzCg5YHTHSoB5JMTsTcSSBHw6BUdSJ5SgA=== -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=gofiber/recipes&utm_content=3137):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` or `@coderabbitai title` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
parsley/README.md (1)

1-226: Consider using spaces instead of tabs in markdown

The static analysis tool detected hard tabs throughout the markdown file. While the content is excellent, consider using spaces instead of tabs for better markdown rendering consistency across different platforms.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

58-58: Hard tabs
Column: 1

(MD010, no-hard-tabs)


60-60: Hard tabs
Column: 1

(MD010, no-hard-tabs)


61-61: Hard tabs
Column: 1

(MD010, no-hard-tabs)


63-63: Hard tabs
Column: 1

(MD010, no-hard-tabs)


68-68: Hard tabs
Column: 1

(MD010, no-hard-tabs)


70-70: Hard tabs
Column: 1

(MD010, no-hard-tabs)


71-71: Hard tabs
Column: 1

(MD010, no-hard-tabs)


72-72: Hard tabs
Column: 1

(MD010, no-hard-tabs)


73-73: Hard tabs
Column: 1

(MD010, no-hard-tabs)


90-90: Hard tabs
Column: 1

(MD010, no-hard-tabs)


91-91: Hard tabs
Column: 1

(MD010, no-hard-tabs)


92-92: Hard tabs
Column: 1

(MD010, no-hard-tabs)


98-98: Hard tabs
Column: 1

(MD010, no-hard-tabs)


99-99: Hard tabs
Column: 1

(MD010, no-hard-tabs)


100-100: Hard tabs
Column: 1

(MD010, no-hard-tabs)


101-101: Hard tabs
Column: 1

(MD010, no-hard-tabs)


103-103: Hard tabs
Column: 1

(MD010, no-hard-tabs)


104-104: Hard tabs
Column: 1

(MD010, no-hard-tabs)


106-106: Hard tabs
Column: 1

(MD010, no-hard-tabs)


110-110: Hard tabs
Column: 1

(MD010, no-hard-tabs)


128-128: Hard tabs
Column: 1

(MD010, no-hard-tabs)


134-134: Hard tabs
Column: 1

(MD010, no-hard-tabs)


135-135: Hard tabs
Column: 1

(MD010, no-hard-tabs)


136-136: Hard tabs
Column: 1

(MD010, no-hard-tabs)


137-137: Hard tabs
Column: 1

(MD010, no-hard-tabs)


141-141: Hard tabs
Column: 1

(MD010, no-hard-tabs)


151-151: Hard tabs
Column: 1

(MD010, no-hard-tabs)


153-153: Hard tabs
Column: 1

(MD010, no-hard-tabs)


157-157: Hard tabs
Column: 1

(MD010, no-hard-tabs)


158-158: Hard tabs
Column: 1

(MD010, no-hard-tabs)


173-173: Hard tabs
Column: 1

(MD010, no-hard-tabs)


175-175: Hard tabs
Column: 1

(MD010, no-hard-tabs)


177-177: Hard tabs
Column: 1

(MD010, no-hard-tabs)


181-181: Hard tabs
Column: 1

(MD010, no-hard-tabs)


187-187: Hard tabs
Column: 1

(MD010, no-hard-tabs)


192-192: Hard tabs
Column: 1

(MD010, no-hard-tabs)


194-194: Hard tabs
Column: 1

(MD010, no-hard-tabs)


195-195: Hard tabs
Column: 1

(MD010, no-hard-tabs)


197-197: Hard tabs
Column: 1

(MD010, no-hard-tabs)


198-198: Hard tabs
Column: 1

(MD010, no-hard-tabs)


204-204: Hard tabs
Column: 1

(MD010, no-hard-tabs)


205-205: Hard tabs
Column: 1

(MD010, no-hard-tabs)


206-206: Hard tabs
Column: 1

(MD010, no-hard-tabs)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b539f56 and 7807bab.

⛔ Files ignored due to path filters (2)
  • parsley/go.mod is excluded by !**/*.mod
  • parsley/go.sum is excluded by !**/*.sum, !**/*.sum
📒 Files selected for processing (3)
  • parsley/README.md (1 hunks)
  • parsley/cmd/main.go (1 hunks)
  • parsley/internal/route_handlers/greeter.go (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
parsley/README.md

58-58: Hard tabs
Column: 1

(MD010, no-hard-tabs)


60-60: Hard tabs
Column: 1

(MD010, no-hard-tabs)


61-61: Hard tabs
Column: 1

(MD010, no-hard-tabs)


63-63: Hard tabs
Column: 1

(MD010, no-hard-tabs)


68-68: Hard tabs
Column: 1

(MD010, no-hard-tabs)


70-70: Hard tabs
Column: 1

(MD010, no-hard-tabs)


71-71: Hard tabs
Column: 1

(MD010, no-hard-tabs)


72-72: Hard tabs
Column: 1

(MD010, no-hard-tabs)


73-73: Hard tabs
Column: 1

(MD010, no-hard-tabs)


90-90: Hard tabs
Column: 1

(MD010, no-hard-tabs)


91-91: Hard tabs
Column: 1

(MD010, no-hard-tabs)


92-92: Hard tabs
Column: 1

(MD010, no-hard-tabs)


98-98: Hard tabs
Column: 1

(MD010, no-hard-tabs)


99-99: Hard tabs
Column: 1

(MD010, no-hard-tabs)


100-100: Hard tabs
Column: 1

(MD010, no-hard-tabs)


101-101: Hard tabs
Column: 1

(MD010, no-hard-tabs)


103-103: Hard tabs
Column: 1

(MD010, no-hard-tabs)


104-104: Hard tabs
Column: 1

(MD010, no-hard-tabs)


106-106: Hard tabs
Column: 1

(MD010, no-hard-tabs)


110-110: Hard tabs
Column: 1

(MD010, no-hard-tabs)


128-128: Hard tabs
Column: 1

(MD010, no-hard-tabs)


134-134: Hard tabs
Column: 1

(MD010, no-hard-tabs)


135-135: Hard tabs
Column: 1

(MD010, no-hard-tabs)


136-136: Hard tabs
Column: 1

(MD010, no-hard-tabs)


137-137: Hard tabs
Column: 1

(MD010, no-hard-tabs)


141-141: Hard tabs
Column: 1

(MD010, no-hard-tabs)


151-151: Hard tabs
Column: 1

(MD010, no-hard-tabs)


153-153: Hard tabs
Column: 1

(MD010, no-hard-tabs)


157-157: Hard tabs
Column: 1

(MD010, no-hard-tabs)


158-158: Hard tabs
Column: 1

(MD010, no-hard-tabs)


173-173: Hard tabs
Column: 1

(MD010, no-hard-tabs)


175-175: Hard tabs
Column: 1

(MD010, no-hard-tabs)


177-177: Hard tabs
Column: 1

(MD010, no-hard-tabs)


181-181: Hard tabs
Column: 1

(MD010, no-hard-tabs)


187-187: Hard tabs
Column: 1

(MD010, no-hard-tabs)


192-192: Hard tabs
Column: 1

(MD010, no-hard-tabs)


194-194: Hard tabs
Column: 1

(MD010, no-hard-tabs)


195-195: Hard tabs
Column: 1

(MD010, no-hard-tabs)


197-197: Hard tabs
Column: 1

(MD010, no-hard-tabs)


198-198: Hard tabs
Column: 1

(MD010, no-hard-tabs)


204-204: Hard tabs
Column: 1

(MD010, no-hard-tabs)


205-205: Hard tabs
Column: 1

(MD010, no-hard-tabs)


206-206: Hard tabs
Column: 1

(MD010, no-hard-tabs)

🔇 Additional comments (5)
parsley/cmd/main.go (1)

12-13: LGTM: Nice readability improvement

The addition of a blank line at the beginning of the main function improves code readability by providing better visual separation between the function signature and the first statement.

parsley/internal/route_handlers/greeter.go (1)

27-28:

❓ Verification inconclusive

Be aware of behavior change in error handling

The error handling for the "polite" query parameter has been simplified but introduces a behavior change. Previously, if parsing failed, it would likely default to true. Now if parsing fails, the zero value (false) will be used instead.

This might affect how the API responds to invalid "polite" parameter values.


🏁 Script executed:

#!/bin/bash
# Check if there are any tests that depend on this behavior
rg -A 5 -B 5 "polite.*ParseBool" --glob "*.go" --glob "*.json" --glob "*.md" | grep -v "parsley/internal/route_handlers/greeter.go"

Length of output: 633


Action Required: Confirm default behavior for invalid “polite” parameter values

We’ve simplified error handling in parsley/internal/route_handlers/greeter.go (lines 27–28):

  • politeFlag := ctx.Query("polite", defaultPoliteFlag)
  • polite, _ := strconv.ParseBool(politeFlag)

Now, any invalid Boolean string (e.g. ?polite=notabool) silently falls back to Go’s zero value (false). Previously, code would have defaulted to defaultPoliteFlag (typically "true") on parse errors.

This change may alter your API’s behavior for malformed polite parameters. Please verify that falling back to false is intended. If not, consider:

  • Restoring an explicit error check and assigning polite = defaultPoliteValue on parse failure
  • Adding unit tests to cover invalid polite values
  • Updating the example in README.md to match the intended behavior
parsley/README.md (3)

13-41: Great documentation improvements

The addition of the Prerequisites section and the reformatted Key Features and Overview sections significantly improve the documentation clarity. The inclusion of Go version requirements (1.23+) helps users understand compatibility constraints.


43-212: Excellent step-by-step tutorial

The comprehensive step-by-step guide with detailed code examples makes the recipe much more accessible. The breakdown of each component (Fiber instance configuration, service registration, route handlers) with code snippets provides a clear learning path for users.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

58-58: Hard tabs
Column: 1

(MD010, no-hard-tabs)


60-60: Hard tabs
Column: 1

(MD010, no-hard-tabs)


61-61: Hard tabs
Column: 1

(MD010, no-hard-tabs)


63-63: Hard tabs
Column: 1

(MD010, no-hard-tabs)


68-68: Hard tabs
Column: 1

(MD010, no-hard-tabs)


70-70: Hard tabs
Column: 1

(MD010, no-hard-tabs)


71-71: Hard tabs
Column: 1

(MD010, no-hard-tabs)


72-72: Hard tabs
Column: 1

(MD010, no-hard-tabs)


73-73: Hard tabs
Column: 1

(MD010, no-hard-tabs)


90-90: Hard tabs
Column: 1

(MD010, no-hard-tabs)


91-91: Hard tabs
Column: 1

(MD010, no-hard-tabs)


92-92: Hard tabs
Column: 1

(MD010, no-hard-tabs)


98-98: Hard tabs
Column: 1

(MD010, no-hard-tabs)


99-99: Hard tabs
Column: 1

(MD010, no-hard-tabs)


100-100: Hard tabs
Column: 1

(MD010, no-hard-tabs)


101-101: Hard tabs
Column: 1

(MD010, no-hard-tabs)


103-103: Hard tabs
Column: 1

(MD010, no-hard-tabs)


104-104: Hard tabs
Column: 1

(MD010, no-hard-tabs)


106-106: Hard tabs
Column: 1

(MD010, no-hard-tabs)


110-110: Hard tabs
Column: 1

(MD010, no-hard-tabs)


128-128: Hard tabs
Column: 1

(MD010, no-hard-tabs)


134-134: Hard tabs
Column: 1

(MD010, no-hard-tabs)


135-135: Hard tabs
Column: 1

(MD010, no-hard-tabs)


136-136: Hard tabs
Column: 1

(MD010, no-hard-tabs)


137-137: Hard tabs
Column: 1

(MD010, no-hard-tabs)


141-141: Hard tabs
Column: 1

(MD010, no-hard-tabs)


151-151: Hard tabs
Column: 1

(MD010, no-hard-tabs)


153-153: Hard tabs
Column: 1

(MD010, no-hard-tabs)


157-157: Hard tabs
Column: 1

(MD010, no-hard-tabs)


158-158: Hard tabs
Column: 1

(MD010, no-hard-tabs)


173-173: Hard tabs
Column: 1

(MD010, no-hard-tabs)


175-175: Hard tabs
Column: 1

(MD010, no-hard-tabs)


177-177: Hard tabs
Column: 1

(MD010, no-hard-tabs)


181-181: Hard tabs
Column: 1

(MD010, no-hard-tabs)


187-187: Hard tabs
Column: 1

(MD010, no-hard-tabs)


192-192: Hard tabs
Column: 1

(MD010, no-hard-tabs)


194-194: Hard tabs
Column: 1

(MD010, no-hard-tabs)


195-195: Hard tabs
Column: 1

(MD010, no-hard-tabs)


197-197: Hard tabs
Column: 1

(MD010, no-hard-tabs)


198-198: Hard tabs
Column: 1

(MD010, no-hard-tabs)


204-204: Hard tabs
Column: 1

(MD010, no-hard-tabs)


205-205: Hard tabs
Column: 1

(MD010, no-hard-tabs)


206-206: Hard tabs
Column: 1

(MD010, no-hard-tabs)


213-226: Clear application execution instructions

The run instructions are now much clearer with specific commands to start the application and test the endpoint. This significantly improves the user experience when following the tutorial.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (5)
parsley/README.md (5)

28-33: Fix verb agreement in Key features
Line 31 reads “Constructor-based dependency injection wire services together.” It should be “wires services together” or “wiring services together.”

- * **Automatic dependency injection:** Constructor-based dependency injection wire services together.
+ * **Automatic dependency injection:** Constructor-based dependency injection wires services together.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~31-~31: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... Constructor-based dependency injection wire services together. * **Simplified route...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


54-74: Rename shadowed context variable in main
Using context as a local variable shadows the imported context package. It’s idiomatic to name it ctx.

- func main() {
-     context := context.Background()
+ func main() {
+     ctx := context.Background()
     // Runs a Fiber instance as a Parsley-enabled app
-    bootstrap.RunParsleyApplication(context, internal.NewApp,
+    bootstrap.RunParsleyApplication(ctx, internal.NewApp,
         modules.ConfigureFiber,
         modules.ConfigureGreeter)
 }

148-156: Route-handler import order follows Go conventions
Consider grouping standard, external, then local imports (strconv, github.com/fiber/..., then parsley-app/internal/services).

 import (
-   "strconv"
-   "parsley-app/internal/services"
-   "github.com/gofiber/fiber/v2"
+   "strconv"
+
+   "github.com/gofiber/fiber/v2"
+
+   "parsley-app/internal/services"
 )

168-176: HandleSayHelloRequest: consider explicit error handling
Currently, parse errors are ignored in strconv.ParseBool. For robust examples, you might return 400 Bad Request on invalid input.

polite, err := strconv.ParseBool(politeFlag)
if err != nil {
    return ctx.Status(fiber.StatusBadRequest).SendString("invalid polite flag")
}

197-200: Clarify default listening port in curl example
The port 5502 appears without context—consider noting that it’s the default in this example or making it configurable.

For this recipe the default listening port is 5502:
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7807bab and de9613d.

📒 Files selected for processing (1)
  • parsley/README.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
parsley/README.md

[uncategorized] ~31-~31: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... Constructor-based dependency injection wire services together. * **Simplified route...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

🔇 Additional comments (14)
parsley/README.md (14)

14-17: Prerequisites section is clear and helpful
Good addition; this makes it explicit which Go version is needed to run the example.


21-26: Overview bullets are concise and accurate
The three-step overview (bootstrap, register, resolve) cleanly communicates the example’s flow.


43-50: Step-by-step guide is clear
Good instructions for cloning and navigating to the example directory.


76-79: RunParsleyApplication description reads well
This paragraph effectively explains how the bootstrap function orchestrates the app.


81-84: Configure and register Fiber header & intro are on point
The heading and lead-in clearly introduce the Fiber-registration section.


86-93: Imports in modules snippet look correct
The example shows the necessary imports for ConfigureFiber.


95-104: ConfigureFiber implementation is accurate
The singleton registration of Fiber and the route-handlers module invocation match the code.


107-110: newFiber factory is clear
This helper function is straightforward and well documented.


115-118: Service definition section is well explained
The description sets up the subsequent code snippet nicely.


119-140: Greeter service snippet is correct
The interface and implementation align with the tutorial narrative.


158-163: greeterRouteHandler struct and const are clear
The code correctly shows dependency injection for the greeter service.


164-167: Route registration is straightforward
Good demonstration of how to wire a handler into Fiber’s routing.


179-185: Factory for greeterRouteHandler is well presented
The constructor function matches the DI pattern introduced earlier.


189-194: Run application snippet is accurate
Clear instruction to start the app via go run.

@matzefriedrich matzefriedrich force-pushed the parsley-recipe-v1-update branch from 32bb289 to fb02451 Compare May 19, 2025 21:45
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
parsley/README.md (3)

13-17: Consider expanding the prerequisites
The new Prerequisites section is a great addition. To help users run this example in isolation, you might also mention initializing the Go module (e.g., go mod init github.com/gofiber/recipes/parsley-app) and ensuring Go is on their PATH (or link to Go installation docs).


46-49: Optimize clone instructions
To reduce clone time and bandwidth, consider a shallow clone flag. For example:

git clone --depth 1 https://github.com/gofiber/recipes.git parsley

This speeds up the workflow for users exploring just the parsley example.


53-74:

❓ Verification inconclusive

Verify module import paths and refine inline comment
The snippet correctly shows fully qualified imports, but please double-check that parsley-app/go.mod declares:

module github.com/gofiber/recipes/parsley-app

to match these paths. Also, for consistency with Go’s commenting style, add a trailing period to the inline comment on the RunParsleyApplication call.

Example diff:

--- a/parsley/README.md
+++ b/parsley/README.md
@@ -69,7 +69,7
-    // Runs a Fiber instance as a Parsley-enabled app
+    // Runs a Fiber instance as a Parsley-enabled app.

You can verify the module path with:


🏁 Script executed:

#!/bin/bash
rg -n '^module github.com/gofiber/recipes/parsley-app$' parsley-app/go.mod

Length of output: 135


🏁 Script executed:

#!/bin/bash
# Locate all go.mod files and print their module declarations
find . -type f -name go.mod -exec echo "==> {} <==" \; -exec sed -n '1,5p' {} \;

Length of output: 84


Verify module path & inline comment
I couldn’t locate a go.mod in the parsley-app/ directory—please confirm:

  • A file at parsley-app/go.mod exists and its first line reads:
    module github.com/gofiber/recipes/parsley-app
    
  • The inline comment on the RunParsleyApplication call ends with a period for Go-style consistency:
--- a/parsley/README.md
+++ b/parsley/README.md
@@ -69,7 +69,7
-    // Runs a Fiber instance as a Parsley-enabled app
+    // Runs a Fiber instance as a Parsley-enabled app.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 32bb289 and fb02451.

📒 Files selected for processing (1)
  • parsley/README.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
parsley/README.md

[typographical] ~220-~220: Use a comma after an introductory phrase.
Context: ...ser, or from the terminal using curl. For this recipe the default listening port is `5...

(COMMA_INTRODUCTORY_WORDS_PHRASES)


[typographical] ~220-~220: It appears that a comma is missing.
Context: ...rom the terminal using curl. For this recipe the default listening port is 5502: ...

(DURING_THAT_TIME_COMMA)

🔇 Additional comments (4)
parsley/README.md (4)

21-25: Clear and concise Overview
The Overview bullets succinctly outline bootstrapping, registration, and resolution steps. This high-level summary is spot on.


28-32: Well-structured Key features
The Key features section is informative and consistently formatted. Nice work!


35-39: Consistent list formatting in “How it works”
Each bullet now correctly has a leading *. The list is uniform and easy to follow.


42-45: Step-by-step heading and intro
Introducing the “The recipe – step by step” section with a brief guide sets clear expectations for readers. Looks good.

@matzefriedrich matzefriedrich force-pushed the parsley-recipe-v1-update branch from fb02451 to 3f1e861 Compare May 20, 2025 20:42
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
parsley/README.md (1)

220-220: Typographical fix: comma after introductory phrase
Add a comma after “For this recipe” to improve readability.

- …using `curl`. For this recipe the default listening port is `5502`:
+ …using `curl`. For this recipe, the default listening port is `5502`:
🧰 Tools
🪛 LanguageTool

[typographical] ~220-~220: Use a comma after an introductory phrase.
Context: ...ser, or from the terminal using curl. For this recipe the default listening port is `5...

(COMMA_INTRODUCTORY_WORDS_PHRASES)


[typographical] ~220-~220: It appears that a comma is missing.
Context: ...rom the terminal using curl. For this recipe the default listening port is 5502: ...

(DURING_THAT_TIME_COMMA)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fb02451 and 3f1e861.

⛔ Files ignored due to path filters (2)
  • parsley/go.mod is excluded by !**/*.mod
  • parsley/go.sum is excluded by !**/*.sum, !**/*.sum
📒 Files selected for processing (6)
  • parsley/README.md (1 hunks)
  • parsley/cmd/main.go (1 hunks)
  • parsley/internal/application.go (1 hunks)
  • parsley/internal/modules/greeter_module.go (1 hunks)
  • parsley/internal/modules/route_handlers_module.go (1 hunks)
  • parsley/internal/route_handlers/greeter.go (2 hunks)
✅ Files skipped from review due to trivial changes (3)
  • parsley/internal/modules/route_handlers_module.go
  • parsley/internal/application.go
  • parsley/internal/route_handlers/greeter.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • parsley/internal/modules/greeter_module.go
  • parsley/cmd/main.go
🧰 Additional context used
🪛 LanguageTool
parsley/README.md

[typographical] ~220-~220: Use a comma after an introductory phrase.
Context: ...ser, or from the terminal using curl. For this recipe the default listening port is `5...

(COMMA_INTRODUCTORY_WORDS_PHRASES)


[typographical] ~220-~220: It appears that a comma is missing.
Context: ...rom the terminal using curl. For this recipe the default listening port is 5502: ...

(DURING_THAT_TIME_COMMA)

🔇 Additional comments (6)
parsley/README.md (6)

13-17: Well-structured “Prerequisites” section
The new Prerequisites section clearly states the minimum Go version required. This addition improves discoverability of setup requirements for readers.


21-25: Clear and concise “Overview” section
The steps “Bootstrap the application”, “Register dependencies”, and “Resolve dependencies” are well articulated. This helps readers quickly grasp the high-level workflow.


28-32: Informative “Key features” list
The bullet points succinctly highlight modularity, DI, and route management benefits. This enhances the readability of feature highlights.


37-40: Consistent “How it works” explanation
The three bullets uniformly describe the roles of main, modules, and route handlers. The formatting is now consistent.


42-49: Comprehensive “The recipe – step by step” guide
The added instructional text and shell snippet (git clone…, cd recipes/parsley) provide a smooth onboarding path. The use of a fenced sh block is appropriate for clarity.


53-62:

❓ Verification inconclusive

Verify updated import paths in cmd/main.go snippet
The fully qualified module paths under github.com/gofiber/recipes/parsley-app appear correct, but please ensure they match the module declaration in your go.mod.

Run this script from the repo root to confirm no missing or stale imports:


🏁 Script executed:

#!/bin/bash
# Search for import statements in the example
rg --type-go 'github.com/gofiber/recipes/parsley-app/internal' -A2

Length of output: 504


To properly verify both your module declaration and the updated import paths, let’s re-run with a corrected check:

This will confirm that:

  • Your go.mod’s module line matches github.com/gofiber/recipes/parsley-app.
  • All imports of parsley-app/internal in your .go files are up-to-date.

🏁 Script executed:

#!/bin/bash
# Check the module path in go.mod
echo "Module declaration:"
grep '^module ' go.mod

# Search all Go files for the parsley-app/internal import
echo -e "\nFound imports:"
rg 'github.com/gofiber/recipes/parsley-app/internal' -A2 --glob '*.go'

Length of output: 1428


Let’s locate the go.mod file(s) and verify their module declarations:


🏁 Script executed:

#!/usr/bin/env bash
echo "Searching for go.mod files..."
find . -type f -name go.mod

echo -e "\nModule declarations found:"
find . -type f -name go.mod -exec grep '^module ' {} \;

Length of output: 228


Confirm presence of go.mod and module declaration
I wasn’t able to locate a go.mod file in the repo—please ensure:

  • A go.mod exists at the repository (or relevant submodule) root.
  • Its module line is set to github.com/gofiber/recipes/parsley-app.
  • All imports (e.g. github.com/gofiber/recipes/parsley-app/internal/...) match that module path.

@matzefriedrich matzefriedrich force-pushed the parsley-recipe-v1-update branch 2 times, most recently from eea8398 to ff8ffec Compare May 21, 2025 18:59
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
parsley/README.md (1)

56-64: Reorder import groups for idiomatic Go style
Consider grouping imports in this order: standard library, external packages, then internal modules. For example:

import (
    "context"

    "github.com/matzefriedrich/parsley/pkg/bootstrap"

    "github.com/gofiber/recipes/parsley-app/internal"
    "github.com/gofiber/recipes/parsley-app/internal/modules"
)

This aligns with common Go conventions and improves readability.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3f1e861 and ff8ffec.

⛔ Files ignored due to path filters (2)
  • parsley/go.mod is excluded by !**/*.mod
  • parsley/go.sum is excluded by !**/*.sum, !**/*.sum
📒 Files selected for processing (6)
  • parsley/README.md (1 hunks)
  • parsley/cmd/main.go (1 hunks)
  • parsley/internal/application.go (1 hunks)
  • parsley/internal/modules/greeter_module.go (1 hunks)
  • parsley/internal/modules/route_handlers_module.go (1 hunks)
  • parsley/internal/route_handlers/greeter.go (2 hunks)
✅ Files skipped from review due to trivial changes (2)
  • parsley/internal/application.go
  • parsley/internal/modules/route_handlers_module.go
🚧 Files skipped from review as they are similar to previous changes (3)
  • parsley/internal/route_handlers/greeter.go
  • parsley/cmd/main.go
  • parsley/internal/modules/greeter_module.go
🔇 Additional comments (6)
parsley/README.md (6)

13-16: Add Prerequisites section – Good addition
Clearly states the required Go version for this example, helping users prepare their environment.


21-26: Overview bullets are clear and concise
The three-step breakdown (bootstrap, register, resolve) provides a straightforward introduction to using Parsley with GoFiber.


29-33: Key features list is well-structured
Effectively highlights the modular configuration, automatic DI, and simplified route management benefits.


35-39: How it works section reads smoothly
Succinctly explains bootstrapping, module configuration, and handler injection using the Greeter service.


42-49: Step-by-step guide is thorough
The “The recipe – step by step” walkthrough, including clone commands, makes the example very approachable.


65-73: Main function example aligns with the tutorial
The RunParsleyApplication invocation and its parameters (internal.NewApp, ConfigureFiber, ConfigureGreeter) correctly illustrate the bootstrapping process described above.

@matzefriedrich matzefriedrich force-pushed the parsley-recipe-v1-update branch from ff8ffec to 2a81db7 Compare May 22, 2025 12:34
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (12)
parsley/README.md (12)

14-17: Clarify Parsley installation in Prerequisites
The Prerequisites section specifies “Go 1.23+”, but it doesn’t mention how to obtain or install the Parsley framework itself. Please add a note or link about fetching the Parsley module (e.g., go get github.com/matzefriedrich/parsley@latest) or installing any CLI tooling if required.


21-25: Enhance Overview with direct Parsley documentation link
The Overview refers to “Parsley” but doesn’t link the term to the official docs or repo. Consider hyperlinking to the Parsley GitHub or official documentation to help readers dive deeper:

* **Bootstrap the application:** Set up and configure the Fiber app using [Parsley’s DI container](https://github.com/matzefriedrich/parsley).

28-32: Ensure consistent bullet punctuation in Key features
Some bullet items end with periods and others don’t. For consistency and readability, either remove all trailing punctuation or add a period at the end of each item.


35-39: Polish “How it works” introductory bullets
The section starts with “## How it works” but the first two bullets are unmodified from before. Consider adding a brief sentence after the header to introduce the list, for example:

Below is an overview of how Parsley wires your application components together.


42-45: Add context before “The recipe – step by step”
The heading jumps straight into the guide. It may help to introduce the section with a one-line summary, e.g.:

In this step-by-step recipe, we’ll build and run a Parsley-enabled Fiber app from scratch.


46-49: Annotate shell snippet with prerequisites
Before cloning, it might be helpful to remind users to install Git or enable modules, e.g.:

# Ensure you have Git installed and Go modules enabled (GO111MODULE=on)
git clone https://github.com/gofiber/recipes.git
cd recipes/parsley

51-52: Clarify file location for cmd/main.go
The text says “The main entry point of the application is in the cmd/main.go.” Consider specifying the full path from the repo root—recipes/parsley/cmd/main.go—so users don’t get lost if they’re not in the example folder.


77-79: Smooth transition from code to explanation
The paragraph “In this file, the RunParsleyApplication function bootstraps the application…” follows immediately after the code. Consider adding a brief “Explanation” subheading or a blank line for visual separation.


81-83: Add subheading consistency for module configuration
You’ve introduced “### Configure and register the Fiber instance”. To maintain consistency, ensure all major steps (“RunParsleyApplication”, “ConfigureFiber”, etc.) follow the same ###-level format and appear in the TOC if one is present.


116-119: Add Go doc comments for Greeter service
The Greeter interface and implementation are clear, but adding Go-style doc comments (e.g., above type Greeter interface) will improve readability for users scanning the code.


163-206: Improve clarity around route handler registration
The section on route handlers is comprehensive, but readers may benefit from a brief diagram or list that outlines the interfaces (RouteHandler), the factory (NewGreeterRouteHandler), and the registration flow before diving into code.


211-224: Mention default listening port earlier
The curl example uses port 5502, but the README doesn’t state where this default port is configured. Suggest adding a note on how to override the port (e.g., via environment variable or Fiber config) or where in the code the default is set.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ff8ffec and 2a81db7.

⛔ Files ignored due to path filters (2)
  • parsley/go.mod is excluded by !**/*.mod
  • parsley/go.sum is excluded by !**/*.sum, !**/*.sum
📒 Files selected for processing (6)
  • parsley/README.md (1 hunks)
  • parsley/cmd/main.go (1 hunks)
  • parsley/internal/application.go (1 hunks)
  • parsley/internal/modules/greeter_module.go (1 hunks)
  • parsley/internal/modules/route_handlers_module.go (1 hunks)
  • parsley/internal/route_handlers/greeter.go (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • parsley/internal/application.go
🚧 Files skipped from review as they are similar to previous changes (4)
  • parsley/internal/modules/route_handlers_module.go
  • parsley/internal/route_handlers/greeter.go
  • parsley/internal/modules/greeter_module.go
  • parsley/cmd/main.go
🔇 Additional comments (3)
parsley/README.md (3)

53-74: Verify module path matches go.mod in code snippet
The imports use github.com/gofiber/recipes/parsley-app/internal, but the directory here is named parsley. Please confirm that the go.mod module directive is module github.com/gofiber/recipes/parsley-app (not parsley), or adjust the paths in the README to match the actual module path.


85-111: Confirm RegisterRouteHandlers is imported and documented
The code calls registry.RegisterModule(RegisterRouteHandlers), but the import for RegisterRouteHandlers isn’t shown here. Verify that the sample includes an import for the module package where RegisterRouteHandlers is defined, or add a comment indicating where to find it.


144-158: Document the Greeter registration factory
The snippet uses services.NewGreeterFactory but the service constructor in the earlier section is named NewGreeter(). Please confirm whether the factory function is NewGreeter or NewGreeterFactory, and update the example for consistency.

Comment on lines +121 to +141
```go
package services

import "fmt"

type Greeter interface {
SayHello(name string, polite bool) string
}

type greeter struct{}

func (g *greeter) SayHello(name string, polite bool) string {
if polite {
return fmt.Sprintf("Good day, %s!\n", name)
}
return fmt.Sprintf("Hi, %s\n", name)
}

func NewGreeter() Greeter {
return &greeter{}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Handle boolean parsing errors in the route handler
In production code, swallowing the error from strconv.ParseBool can lead to unexpected behavior. Consider handling the error explicitly or providing a default response if parsing fails. For example:

polite, err := strconv.ParseBool(politeFlag)
if err != nil {
    return ctx.Status(fiber.StatusBadRequest).SendString("invalid 'polite' flag")
}
🤖 Prompt for AI Agents
In parsley/README.md around lines 121 to 141, the code currently ignores errors
from strconv.ParseBool when parsing the 'polite' flag, which can cause
unexpected behavior. Modify the route handler to explicitly check the error
returned by strconv.ParseBool, and if an error occurs, respond with a bad
request status and an appropriate error message indicating the 'polite' flag is
invalid. This ensures robust error handling and clearer client feedback.

@matzefriedrich matzefriedrich force-pushed the parsley-recipe-v1-update branch from 2a81db7 to e44b348 Compare May 26, 2025 22:41
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
parsley/README.md (1)

13-17: Clarify Go version requirement
Consider specifying the version constraint more explicitly (e.g., “Go 1.23 or higher”) or linking to the official Go installation guide. This helps onboard users who may not have the required version installed.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2a81db7 and e44b348.

⛔ Files ignored due to path filters (2)
  • parsley/go.mod is excluded by !**/*.mod
  • parsley/go.sum is excluded by !**/*.sum, !**/*.sum
📒 Files selected for processing (6)
  • parsley/README.md (1 hunks)
  • parsley/cmd/main.go (1 hunks)
  • parsley/internal/application.go (1 hunks)
  • parsley/internal/modules/greeter_module.go (1 hunks)
  • parsley/internal/modules/route_handlers_module.go (1 hunks)
  • parsley/internal/route_handlers/greeter.go (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • parsley/internal/modules/route_handlers_module.go
🚧 Files skipped from review as they are similar to previous changes (4)
  • parsley/internal/application.go
  • parsley/internal/route_handlers/greeter.go
  • parsley/internal/modules/greeter_module.go
  • parsley/cmd/main.go
🔇 Additional comments (4)
parsley/README.md (4)

21-25: Well-structured overview section
The new bullet list clearly outlines the main steps of using Parsley (bootstrapping, registering, resolving). It’s concise and reader-friendly.


28-32: Key features formatting
Great job on highlighting modular configuration, automatic DI, and simplified route management. The formatting is consistent and easy to scan.


65-68: Avoid shadowing the context package
Renaming the application context variable to ctx is a good practice to prevent collisions with the imported context package.


70-73: Correct DI bootstrapping call
The call to bootstrap.RunParsleyApplication(ctx, internal.NewApp, modules.ConfigureFiber, modules.ConfigureGreeter) accurately reflects the intended registration order and usage.

Comment on lines +42 to +49
## The recipe - step by step

This guide demonstrates integrating the Parsley dependency injection framework with the GoFiber web framework. You can either clone the GoFiber recipes repository and navigate to the **parsley** example, or replicate each module while following the article:

```sh
git clone https://github.com/gofiber/recipes.git
cd recipes/parsley
```
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Mismatch between example directory and import paths
The instructions say to cd recipes/parsley, but the code sample imports from github.com/gofiber/recipes/parsley-app/internal. Please align the directory name and module path—either update the cd command to parsley-app or adjust the import paths (and your module declaration in go.mod) to match the actual folder structure.

Also applies to: 59-60

🤖 Prompt for AI Agents
In parsley/README.md around lines 42 to 49, the directory name in the cd command
does not match the import paths used in the code, causing confusion. Update the
cd command from "cd recipes/parsley" to "cd recipes/parsley-app" to align with
the import paths referencing "parsley-app/internal". Alternatively, adjust the
import paths and the module declaration in go.mod to match the existing
directory name if you prefer to keep the current folder structure.

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.

1 participant