14 lines
858 B
Markdown
14 lines
858 B
Markdown
# Fix Compilation Error: Unused Import
|
|
|
|
The error `handlers_rbac.go:8:2: "github.com/niangaodev/art-code/models" imported and not used` indicates that the `models` package is imported in `handlers_rbac.go` but no functions or types from it are directly used in that file.
|
|
|
|
## Analysis
|
|
- In `handlers_rbac.go`, I defined a local struct `UpdateRolePermissionsRequest` instead of using a model from the `models` package.
|
|
- The functions call `repositories.GetPermissions` and `repositories.GetRoleByID`, which return model types, but these are handled via the `repositories` package or local variables, so the `models` package qualifier itself isn't explicitly used in the code logic.
|
|
|
|
## Solution Plan
|
|
1. **Modify `server/handlers_rbac.go`**:
|
|
- Remove the unused import `"github.com/niangaodev/art-code/models"`.
|
|
|
|
This will resolve the compilation error.
|