From a99f3d940900292bc3fe8eeaaefdc70ae0bb3e8d Mon Sep 17 00:00:00 2001 From: xgopilot Date: Mon, 13 Oct 2025 07:16:39 +0000 Subject: [PATCH] docs: refactor Important Notes with clear workflow and requirements - Add clear 'Validation Workflow' section with numbered steps - Create prominent 'LLGO_ROOT Environment Variable' section - Add requirement: All bug fixes/features MUST include tests - Reorganize Important Notes for better clarity Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: xgopilot --- CLAUDE.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index e7778850..b69138be 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -153,9 +153,31 @@ For testing purposes, you can disable GC: LLGO_ROOT=/path/to/llgo llgo run -tags nogc . ``` +## Validation Workflow + +When fixing bugs or implementing features, follow this workflow: + +1. **Make your code changes** +2. **Write or update tests** - All bug fixes and features MUST include tests +3. **Run the test suite**: `go test ./...` +4. **Build the project**: `go build -v ./...` +5. **Test with examples**: Run relevant demos from `_demo/` directory +6. **Format code**: `go fmt ./...` +7. **Run static analysis**: `go vet ./...` + +## LLGO_ROOT Environment Variable + +**CRITICAL:** Always set `LLGO_ROOT` to the repository root when running llgo during development: + +```bash +export LLGO_ROOT=/path/to/llgo +# or +LLGO_ROOT=/path/to/llgo llgo run . +``` + ## Important Notes -1. **LLGO_ROOT:** Always set `LLGO_ROOT` to the repository root when running llgo during development +1. **Testing Requirement:** All bug fixes and features MUST include tests 2. **Demo Directory:** Examples in `_demo` are prefixed with `_` to prevent standard `go` command from trying to compile them 3. **Defer in Loops:** LLGo intentionally does not support `defer` in loops (considered bad practice) 4. **C Ecosystem Integration:** LLGo uses `go:linkname` directive to link external symbols through ABI