- This is a small Go library integrating the Go Advanced Admin Panel with Gin.
- Key files:
integrator.go(packageadmingin): exposesIntegratorand HTTP helpers.go.mod,go.sum: module and dependencies.README.md,LICENSE.
- Tests are not yet present; add
*_test.gofiles alongside sources.
- Build:
go build ./...— verifies the module compiles. - Test:
go test ./...— runs unit tests; use-vfor verbose and-coverfor coverage. - Vet:
go vet ./...— catches common issues; fix warnings before PRs. - Format:
gofmt -s -w .and (optional)goimports -w .. - Local replace (when developing against local admin repo): add in
go.modreplace github.com/go-advanced-admin/admin => ../admin
- Follow idiomatic Go (Go 1.24+ as in
go.mod). - Use
gofmtformatting; no custom style. Keep imports grouped/ordered. - Naming:
- Exported API uses PascalCase (e.g.,
Integrator,NewIntegrator). - Unexported helpers use lowerCamelCase. Package name remains
admingin.
- Exported API uses PascalCase (e.g.,
- Function signatures should accept/return Gin and admin types explicitly; avoid interface{} unless necessary.
- Use the standard
testingpackage; table‑driven tests preferred. - Place tests in
*_test.gowithin the same package (package admingin). - Example:
func TestHandleRoute(t *testing.T) { ... } - Run locally with
go test ./... -cover; target ≥80% for new code.
- Use Conventional Commits:
feat:,fix:,docs:,chore:,refactor:,test:(matches Git history). - PRs must include:
- Clear description, motivation, and scope; link related issues.
- Tests for new behavior and updates to
README.mdwhen public API changes. - Passing build,
go vet, and formatting checks. - Small, focused diffs; avoid unrelated refactors.
- Do not commit secrets. Keep dependencies current:
go get -u ./...and review changes. - (Optional) Run
govulncheck ./...if available.