Development Guide¶
Requirements¶
- Go 1.26+
- macOS, Linux, or Windows (host PC)
- pre-commit for local hooks
Setup¶
git clone https://github.com/ykus4/memdroid.git
cd memdroid
go mod download
# Install pre-commit hooks
brew install pre-commit # or: pip install pre-commit
pre-commit install
Build¶
Pre-commit Hooks¶
Configured in .pre-commit-config.yaml:
| Hook | What it does |
|---|---|
go-fmt |
Formats all .go files with gofmt |
go-vet |
Runs go vet ./... |
go-imports |
Cleans up import blocks with goimports |
golangci-lint |
Runs linters defined in .golangci.yml |
Run manually at any time:
Linter config: .golangci.yml
Enabled: gofmt, goimports, govet, errcheck, staticcheck
Adding a New Feature¶
- Decide which package it belongs to:
internal/memory/search/— scanning and filtering logicinternal/memory/modify/— write-side operationsinternal/memory/watch/— background monitoringinternal/memory/store/— persistence (bookmarks, JSON)internal/process/— process lifecycle-
internal/driver/adb/— ADB-level operations -
Add the CLI handler to the appropriate
cli_*.gofile (or create a new one for a distinct category). Add a menu entry inprintMenuand a dispatch case inmain.go. -
Register any new REST endpoint in
internal/server/server.go. -
Update docs/usage.md and docs/architecture.md.
Commit Convention¶
Write descriptive commit messages. Format:
Example: