Skip to content

Conversation

@hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Dec 12, 2025

📑 Description

Related Issue: goravel/goravel#423

This pull request updates the setup process for installing and uninstalling the Postgres service provider, focusing on improving how the module import path is managed and simplifying the setup code. The main changes involve using a new setup variable to encapsulate setup logic, updating references from modulePath to moduleImport, and slightly restructuring method chaining for clarity.

Setup process improvements:

  • Introduced a setup variable to store the result of packages.Setup(os.Args), streamlining subsequent method calls and reducing code duplication.
  • Replaced usage of modulePath with moduleImport by calling setup.Paths().Module().Import(), ensuring the correct import path is used throughout the setup and uninstall logic. [1] [2]

Code structure and clarity:

  • Simplified the method chaining for Install and Uninstall by chaining directly from the setup variable and removing unnecessary line breaks, making the code easier to read and maintain. [1] [2]

Dependency update:

  • Updated the github.com/goravel/framework dependency in go.mod to a newer commit, ensuring compatibility with the latest framework changes.

✅ Checks

  • Added test cases for my code

@hwbrzzl hwbrzzl marked this pull request as ready for review December 12, 2025 11:21
Copilot AI review requested due to automatic review settings December 12, 2025 11:21
@hwbrzzl hwbrzzl merged commit ffa1840 into master Dec 12, 2025
9 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request optimizes the setup process for the Postgres service provider by introducing a reusable setup variable and modernizing the module path retrieval method. The refactoring improves code clarity and reduces redundancy while maintaining the same functionality.

  • Introduced a setup variable to avoid redundant calls to packages.Setup(os.Args)
  • Replaced modulePath with moduleImport using the new setup.Paths().Module().Import() API
  • Simplified method chaining for better readability

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
setup/setup.go Refactored to use a setup variable and replaced modulePath with moduleImport throughout install/uninstall logic
go.mod Updated goravel/framework dependency to support the new setup API
go.sum Updated checksums for the framework dependency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants