858 B
858 B
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 structUpdateRolePermissionsRequestinstead of using a model from themodelspackage. - The functions call
repositories.GetPermissionsandrepositories.GetRoleByID, which return model types, but these are handled via therepositoriespackage or local variables, so themodelspackage qualifier itself isn't explicitly used in the code logic.
Solution Plan
- Modify
server/handlers_rbac.go:- Remove the unused import
"github.com/niangaodev/art-code/models".
- Remove the unused import
This will resolve the compilation error.