| name | cgo-bindings |
| description | Handles C-bindings, building/testing of C/CGo assets, code generation, and C header verification. Use when working on C/CGo files under insights/C/. |
C/CGo and C-Bindings Operations
When to Use
- Working on C header/source files or CGo wrappers in
insights/C/.
- Generating C assets or updating dynamic library mappings.
- Validating native builds.
Setup and Native Host Requirements
If building or testing Go modules with dynamic C dependencies locally on your host (rather than inside a clean build environment or runner):
Procedures
1) Code Generation (C Bindings)
When any C-headers, CGo files, or bindings are modified:
2) Lint and Format Checks
- Enforce formatting of C/C++ headers and sources using
clang-format:
- Run the CI gating script or manually format files in
insights/C/ using your preferred clang-format wrapper.
3) C/CGo Integration & Thread-Safety Verification
C/CGo boundaries are highly susceptible to memory access violations, thread linkage errors, and race conditions.