GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing pypi.org — codeanalyzer-go codeanalyzer-go 0.3.0Prebuilt codeanalyzer-go (cango) backend binary for CLDK (codellm-devkit). pip install codeanalyzer-go codeanalyzer-go (
|
| Level | Flag | What runs | Status |
|---|---|---|---|
| 1 | -a 1 (default) |
Symbol table only — types, functions, call sites | Implemented |
| 2 | -a 2 |
Level 1 + resolver-based call graph via go/types |
Implemented |
| 3 | -a 3 |
Level 2 + per-callable statement nodes and cfg / cdg / ddg |
Implemented |
| 4 | -a 4 |
Level 3 + interprocedural SDG: VTA dispatch, parameter vertices, param_in / param_out, summary, port and points-to ddg, library stand-ins |
Implemented |
Level 1 loads each package with packages.NeedSyntax | NeedTypes | NeedTypesInfo and walks the AST file by file. Call sites are recorded with callee_signature = null at this stage.
Level 3 completes every callable's body with its statement, control (branch, loop,
switch, return) and synthetic (@entry, @exit) nodes around the L1 call nodes, and adds
three intra-callable edge lists: cfg (control flow, including the defer chain and panic
exception edges), cdg (control dependence from post-dominators) and ddg (syntactic
reaching definitions over k-limited access paths, prov: ["ssa"]). --graph-field-depth <k>
(default 3, minimum 1) bounds the access paths (x.f.g.h → x.f.g.* at k = 3) and is
recorded in the envelope as k_limit. It is a flag error below -a 3 and with
--emit neo4j. Callables are analyzed in parallel (-j), and the output is byte-identical
for every -j. L3 only adds to the L2 output: every L2 fact stays as it is.
Level 4 is whole-program. It builds go/ssa for the project packages over the same load and
runs VTA (golang.org/x/tools/go/callgraph/vta) over the project's functions, so interface and
function-value calls get their concrete targets: call_graph gains those edges with
prov: ["vta"] (an L2 edge is never changed). Every callable gets formal_in / formal_out
vertices (parameters, receiver, closure captures, the package variables it reads or writes,
results), and every resolved call site gets actual_in / actual_out vertices, wired into the
body's ddg (prov: ["reaching-defs"]). param_in / param_out (application scope) join each
call site to every target, including the interface method itself for an interface call, and a
bottom-up pass over the call graph's SCCs puts summary edges (actual_in → actual_out) at
each call site. Library callees get a stand-in in external_symbols (body holds only its
formal vertices; summary all inputs → all outputs unless --library-models overrides it). A
type-based may-alias oracle adds ddg edges with prov: ["points-to"]. -a 3 output is a
subset of -a 4 output, and -j 1 and -j N output are byte-identical.
Degradation. When L4 cannot build all it needs, it still emits and records why in the
envelope's degraded[]. Each entry has a code, an optional detail, and optional packages[]
and callables[]. The codes are:
no_ssa / partial_ssa: SSA failed, in whole or for some packages;no_vta: VTA failed;no_cha: the CHA complement for library-originated values failed (its targets are dropped);partial_types: some packages have type errors;unmapped_ssa: SSA functions or calls that map to no callable;l3_skipped: callables without an L3 result, which get a pass-through summary;range_func: range-over-func, which is not modelled at L4.It also logs one warning per entry. --strict makes any degradation a non-zero exit.
--library-models <file.json> overrides stand-in summaries:
{"strconv/Atoi": [], "strings/TrimSpace": [["s", "<return>"]]}. A key is the external id's
<import-path>/<sig> tail, and a value is a list of [in, out] pairs of of names ([] = no
summary edges). A model changes summaries, not statement-level reachability: in
n, err := strconv.Atoi(id) the value assigned at the call site keeps its reaching-definition
edge from id, which is correct data flow. A model is therefore not a sanitizer. Cutting such
a flow is the SDK taint analysis's job
(codellm-devkit/.github#103). A variable
cut on n is also bypassed, by implicit flow through err and by the coarse host wiring. An
entry naming an of the external lacks falls back to all-to-all, with a warning. A key no call
site targets is ignored, with a warning. The flag is valid only at -a 4 and with
--emit neo4j.
-t / --target-files is not supported at -a 4 (whole-program): it is an error. Use
-a 3 -t, or run without -t.
Known limits (see docs/design/notes/l3-dataflow-metrics.md § L4):
sort.Slice, http.HandleFunc) is not an
edge;ctx.Value(k).(Store),
sync.Map.Load, a library container), directly or through project code (results,
parameters, captures, fields, globals, container elements), binds every project type
implementing the interface (a CHA complement). Storage is tracked by container type (every
instance of a struct field), which is sound but coarser than VTA;range_func);summary edges whose two ends are both <global>: vertices are omitted
(codeanalyzer-go#30). Reachability is unchanged, but a depth-bounded slice can stop earlier
than it would through that shortcut.Level 2 adds a resolver pass: for each call site, go/types resolves the callee to its full import-path signature (pkgImportPath.TypeName.MethodName). A project callee becomes an edge to its callable; a library callee (stdlib, a dependency, or a package vendored under vendor/) becomes an edge to an @external symbol, recorded once in application.external_symbols. A callee that is neither (an interface method of a project type, a conversion, a builtin, a call through a function value) gets no edge. Every resolved call node's callee is backfilled.
cango emits the canonical CLDK v2 shape — the shape the v2 Python SDK loader consumes
and the step-by-step section above produces.
The document is a manifest envelope wrapping one application containment tree. Every
node carries a can://<namespace>/<app>/… id, a kind, and a span:
{
"identity_version": 2,
"schema_version": "2.0.0",
"language": "go",
"max_level": 2,
"analyzer": { "name": "codeanalyzer-go", "version": "0.1.0" },
"application": {
"id": "can://myapp/myapp",
"identity_version": 2,
"application_name": "myapp",
"identity_namespace": "myapp",
"kind": "application",
"symbol_table": {
"pkg/greeter/greeter.go": {
"id": "can://myapp/myapp/go/pkg/greeter/greeter.go",
"kind": "module",
"package": "greeter",
"span": { "start": [1, 1], "end": [40, 2], "bytes": [0, 812] },
"source": "package greeter\n\n...",
"content_hash": "…",
"imports": [ { "name": "fmt", "path": "fmt", "span": {…} } ],
"types": {
"Greeter": {
"id": "can://myapp/myapp/go/pkg/greeter/greeter.go/example.com/pkg/greeter.Greeter",
"kind": "struct",
"span": { "start": [5, 1], "end": [7, 2], "bytes": [17, 63] },
"fields": {
"Prefix": { "id": "…/Prefix", "kind": "field", "type": "string", "span": {…} }
},
"callables": {
"example.com/pkg/greeter.Greeter.Greet": {
"id": "can://myapp/myapp/go/pkg/greeter/greeter.go/example.com/pkg/greeter.Greeter/example.com/pkg/greeter.Greeter.Greet",
"kind": "method",
"signature": "example.com/pkg/greeter.Greeter.Greet",
"span": { "start": [9, 1], "end": [11, 2], "bytes": [65, 140] },
"parameters": [ { "name": "name", "type": "string", "span": {…} } ],
"return_type": "string",
"error_channel": ["error"],
"metrics": { "cyclomatic": 1 },
"body": {
"10:2": {
"kind": "call",
"id": "can://myapp/myapp/go/pkg/greeter/greeter.go/…/example.com/pkg/greeter.Greeter.Greet@10:2",
"span": { "start": [10, 2], "end": [10, 30], "bytes": [90, 118] },
"callee": "can://myapp/myapp/go/pkg/greeter/greeter.go/…/example.com/pkg/greeter.format"
}
}
}
}
}
},
"functions": {
"example.com/main.main": { "id": "…", "kind": "function", "signature": "…", "body": {…} }
}
}
},
"call_graph": [
{
"src": "can://myapp/myapp/go/main.go/…/example.com/main.main",
"dst": "can://myapp/myapp/go/pkg/greeter/greeter.go/…/example.com/pkg/greeter.Greeter.Greet",
"prov": ["go/types"],
"weight": 1
}
]
}
}
Key v2 schema properties:
schema_version ("2.0.0"), language ("go"), max_level (1–4),
k_limit (L3+: the --graph-field-depth value), degraded[] (L4, only when something
degraded) and analyzer{name,version} wrap a single application node.application → module → type → callable → body, keyed as
symbol_table (modules, by project-relative file path), types, callables, body.id — every node carries a durable can://<namespace>/<app>/go/<file>/<type>/<signature> id;
<app> is the --app-name anchor. A body node is keyed by line:col in its callable's body
map and carries id = <callable-id>@<key> at every level, from -a 1 on.kind — module · type kinds struct | interface | alias | defined (collapses v1's
is_interface) · callable kinds function | method | lambda · body call.base_types: [] (type, optional) — embedded type ids (struct/interface embedding — the
explicit spine), as opposed to interfaces the type is computed to satisfy.span — {start:[line,col], end:[line,col], bytes:[from,to]}; bytes are UTF-8 byte
offsets into the owning module.source (source is stored once per module, every node slices it).source_file (callable, optional) — set when a method is declared in a different file
than its receiver type, and on every closure (nested ones too) inside such a method; the
callable stays nested under the type, and its span.bytes (and its body nodes' spans) index
symbol_table[source_file].source instead of the nesting module's.error_channel: [] — populated from error-typed returns (the returns also stay in
return_type). Closures nest as callables{} on the enclosing callable.body call nodes — callee is the sanctioned null → id slot: null at L1; at L2 a
project callable's can:// id, or for a library (stdlib or dependency) callee its
can://<namespace>/<app>/@external/<import-path>/<sig> id, a key of external_symbols. It stays null
for conversions, builtins, calls through function values and unresolved sites. is_goroutine / is_deferred
are boolean flags emitted only when true (a plain call omits them), for go f() / defer f().call_graph edges — {src, dst, prov, weight}; src is a callable id in the tree and
dst a callable id or an external_symbols key (never a raw signature); prov is resolver
provenance, e.g. ["go/types"].external_symbols (application, L2, optional) — one entry per library callee, keyed by
its @external id: {id, kind: "external", name, module, signature, parameters[], return_type}
(parameters carry no span). Absent when no library call was resolved.-a 3) — body gains statement / branch / loop / switch / return nodes
and the synthetic @entry / @exit (which have no span). Every body node carries id
(<callable-id>@<key>).
A call nested in a statement carries parent, the statement's key. The callable gains
cfg[] {src, dst, kind}, cdg[] {src, dst} and ddg[] {src, dst, var, prov}, whose
endpoints are body keys. See docs/design/specs/v2-schema-structure.md.-a 4) — body gains span-less vertices @formal_in:<i>, @formal_out[:<i>],
<call-key>/actual_in:<i>, <call-key>/actual_out[:<i>], each with of (the bound name:
a parameter or receiver name, _<i>, _recv, <return>, <return>:<i>,
<capture>:<name>, <global>:<pkgpath>::<Name>); actuals carry parent = the call key.
ddg gains prov: ["reaching-defs"] (port wiring) and ["points-to"] edges; a callable gains
summary[] {src, dst} (local keys); the application gains param_in[] / param_out[]
{src, dst, var} (global body-node ids, var = the callee formal's of); an external gains
receiver {name, type} and a stand-in body of its formal vertices (ids
<external-id>@formal_in:<i>).--emit neo4j)--emit neo4j projects the same v2 envelope into a Neo4j property graph. It is a second
projection of the identical analysis — JSON nodes and graph nodes carry the same can://<namespace>/<app>/…
ids, so the two join on one string and are never recomposed. The graph vocabulary is Go-prefixed
labels (:GoModule, :GoType, :GoCallable, :GoField, :GoBodyNode, :GoExternal, plus the
shared merge label :GoSymbol and marker :GoCanNode) and GO_-prefixed relationships
(GO_HAS_MODULE, GO_DECLARES, GO_HAS_METHOD, GO_HAS_FIELD, GO_CALLS, GO_RESOLVES_TO,
GO_IMPORTS, GO_EMBEDS, GO_SATISFIES, …).
There are two output paths, chosen by whether --neo4j-uri is set:
--neo4j-uri unset |
--neo4j-uri set |
|
|---|---|---|
| What happens | Writes a replayable graph.cypher snapshot |
Pushes the graph live over Bolt into a running Neo4j |
| Where | <-o dir>/graph.cypher (or stdout) |
The target database |
| Use for | Review, diffing, loading on your own schedule, CI | A DB you already have running |
Both paths are scoped to one application: every destructive statement is anchored on
:GoCanNode and the can://<namespace>/<app>/ id prefix, so it never touches another app (or a
sibling-language graph) in the same database. The projection is deterministic — a second emit
is byte-identical.
What a re-emit replaces depends on the path:
graph.cypher snapshot and --eager Bolt push: the app's subgraph is purged and
rebuilt, so re-emitting replaces exactly that app's subgraph.:GoBodyNodes and their GO_CFG_NEXT / GO_CDG / GO_DDG
edges, whose ids are keyed on line:col: once lines shift, the old body nodes and their edges
remain beside the new ones. Pass --eager when you push an L3 graph after editing source.
The purge needs a full run: with --target-files it is skipped, because the push carries only
the targeted packages.GO_PARAM_IN / GO_PARAM_OUT, GO_SUMMARY, port GO_DDG) on every push, not only the changed
modules'. It still adds and never removes: stale L4 rows stay until an --eager full run.:GoApplication.max_level (a graph
last pushed at L3, or with -t), or whose stored level is unreadable, upserts every module, so
no L4 row is dropped for a missing L3 endpoint. A push at a lower level onto a higher graph
diffs as usual and leaves the old L4 rows in place (additive). An interrupted push can leave
:GoApplication at the new max_level while some modules still hold older rows; the next lazy
push then trusts the diff. Recover with an --eager full run.--target-files (D9). L4 is whole-program, so --emit neo4j -t projects the targeted modules
at L3 and writes no L4 rows; they keep the last full run's facts until the next full run. It
warns once on stderr: --target-files: projecting the graph at level 3 (level 4 is whole-program); L4 rows keep the last full run's facts until a full run (plus ; --library-models is ignored at level 3 when that flag is set).
--emit neo4jis always full depth. The graph is projected at the max implemented level (L4 — symbol table, call graph, every callable's body nodes withGO_CFG_NEXT/GO_CDG/GO_DDG, and the SDG: vertex:GoBodyNodes withvar,GO_PARAM_IN/GO_PARAM_OUT {var},GO_SUMMARY, stand-in vertices under their:GoExternal, anddegraded_jsonon:GoApplication) and canonical schema v2. Do not pass-a/--analysis-levelwith it — an explicit level is a flag error (--analysis-level does not apply to --emit neo4j), because there is no shallower graph to ask for.
graph.cypher)cango -i /path/to/go/app --emit neo4j -o ./out/
# → writes ./out/graph.cypher
The snapshot is a self-contained script: constraints + indexes, a scoped wipe of this app's subgraph,
then UNWIND … MERGE batches for nodes and relationships. Replay it into any Neo4j with
cypher-shell (see below). Omit -o to stream the Cypher to stdout.
Set --neo4j-uri (or the NEO4J_URI env var) to push directly over Bolt instead of writing a file:
./cango -i /path/to/go/app --emit neo4j \
--neo4j-uri bolt://127.0.0.1:7687 \
--neo4j-user neo4j --neo4j-password <pass>
Credentials and target also read from the environment (NEO4J_URI, NEO4J_USERNAME,
NEO4J_PASSWORD, NEO4J_DATABASE), so you can keep them out of your shell history:
export NEO4J_URI=bolt://127.0.0.1:7687
export NEO4J_PASSWORD=<pass>
cango -i /path/to/go/app --emit neo4j
Use
127.0.0.1rather thanlocalhostif anything else (an SSH tunnel, another DB) might also be listening on7687—localhostcan resolve to the wrong listener.
If you emitted a graph.cypher snapshot, load it into a running Neo4j with cypher-shell:
cypher-shell -a bolt://127.0.0.1:7687 -u neo4j -p <pass> < ./out/graph.cypher
A convenience harness, scripts/load_and_query.sh, loads the snapshot
and runs a set of sample queries — it auto-detects cypher-shell from a Neo4j Desktop or Homebrew
install. It reads graph.cypher from its own directory, so emit the snapshot into scripts/ first
(-o scripts):
# brew install neo4j && neo4j start # (or Neo4j Desktop) — then set a password
cango -i /path/to/go/app --emit neo4j -o scripts # writes scripts/graph.cypher
NEO4J_PASSWORD=<pass> ./scripts/load_and_query.sh # load + query
NEO4J_PASSWORD=<pass> ./scripts/load_and_query.sh --query # queries only
NEO4J_PASSWORD=<pass> ./scripts/load_and_query.sh --check # just test the connection
Or explore visually in Neo4j Browser at http://127.0.0.1:7474 (connect to bolt://127.0.0.1:7687),
paste a query, and swap RETURN p for RETURN … to draw the graph.
Always scope by the can:// id prefix (an index-backed seek via the gocannode_id range index),
never by a bare label scan — replace <app> with your --app-name:
// Node counts by label.
MATCH (n:GoCanNode) RETURN labels(n)[0] AS label, count(*) AS n ORDER BY n DESC;
// Relationship counts by type.
MATCH ()-[r]->() RETURN type(r) AS rel, count(*) AS n ORDER BY n DESC;
// Everything owned by one application (prefix seek).
MATCH (n:GoCanNode) WHERE n.id STARTS WITH 'can://<namespace>/<app>/' RETURN count(n) AS app_nodes;
// Types ranked by method count (the "god struct" finder).
MATCH (t:GoType) OPTIONAL MATCH (t)-[:GO_HAS_METHOD]->(m)
RETURN t.kind AS kind, t.signature AS type, count(m) AS methods ORDER BY methods DESC;
// Most-called callables (in-degree) — the hot utilities.
MATCH (:GoCallable)-[:GO_CALLS]->(b:GoCallable)
RETURN b.signature AS callee, count(*) AS called_by ORDER BY called_by DESC LIMIT 15;
// Everything Command.Execute reaches, transitively (any depth).
MATCH (:GoCallable {signature:'github.com/spf13/cobra.Command.Execute'})-[:GO_CALLS*]->(b)
RETURN DISTINCT b.signature AS reachable ORDER BY reachable;
// External / stdlib packages reached via imports.
MATCH (:GoCanNode)-[:GO_IMPORTS]->(x:GoExternal) RETURN DISTINCT x.path AS import ORDER BY import;
The full, commented catalog — overview/sanity, containment tree, call graph (callers, callees,
reachability, shortest path, entry points, leaves), call-site resolution, imports, inheritance,
metrics, and scoped maintenance — lives in
Eval/Neo4j_eval/queries.cypher, validated against the
spf13/cobra graph.
from cldk import CLDK
analysis = CLDK(language="go").analysis(project_path="/path/to/go/project")
for file_path, go_file in analysis.get_symbol_table().items():
print(file_path, go_file.module_name)
The SDK locates the analyzer via the codeanalyzer-go command on PATH (installed by any of the
methods above, including pip install codeanalyzer-go). See
python-sdk for full API documentation.
This release changes the output contract. If you consume analysis.json or the Neo4j graph,
check the following.
can://go/<app>/<file>/… is now can://<namespace>/<app>/go/<file>/…. Library
callees are can://<namespace>/<app>/@external/<import-path>/<sig>.id at every level. Each body node has id = <callable-id>@<local-key>,
from -a 1 on, not only at -a 3.application.external_symbols describes them. A library call's callee is its
external id instead of null. A type conversion is still a call node, but its callee stays
null; it is no longer resolved to a <Type>.__new__ pseudo-callee.kind can now be alias or defined, not only struct or interface.is_deferred: true.s.A().B(), are now separate call
nodes keyed l:c and l:c/2. Previously the inner call was dropped. Do not parse body keys
as plain line:col.go statement arguments, such as g() in go f(g()), are now call sites.-a 4) is new. It is additive: an -a 3 consumer sees the same document plus new
keys (vertices, of, summary, param_in / param_out, points-to / reaching-defs ddg,
VTA call_graph edges, external receiver / body, degraded). Code that assumes every body
node has a span, or that every ddg edge has prov: ["ssa"], must handle the L4 kinds.
-a 4 -t is an error (whole-program; D9). --library-models is new and valid only at L4.
Measured cost (2026-10-28, analyzer built with go1.27.3, eight real apps). On 7 of 8
apps, the peak RSS of -a 4 is 1.0–1.5× that of -a 3; Kubernetes takes 38 s at 7.9 GB.
nats-server is the outlier at 3.8×, because its globals fan out through one recursive 822-callable
SCC. The JSON output is 1.9–23× that of -a 3. Per-app figures are in
docs/design/notes/l3-dataflow-metrics.md § L4.--emit neo4j projects L4 (D4), adding GO_CFG_NEXT, GO_CDG and GO_DDG, and the SDG
rows GO_PARAM_IN, GO_PARAM_OUT, GO_SUMMARY, vertex :GoBodyNodes with var, and
degraded_json. -a with it is still an error.--eager to drop
stale ones. --emit neo4j -t projects at L3 with a warning (D9). A push at a higher level
than the stored graph upserts everything; a lower-level push leaves the old L4 rows. See
Neo4j projection.:GoBodyNode.call_node is the enclosing statement's local key (the JSON parent), not a
global id.--eager now works on Neo4j 5.x.| Slot | Choice | Rationale |
|---|---|---|
| Runtime | Go binary | Self-contained; no runtime dep for SDK users |
| Structural parser | go/ast (stdlib) |
Part of the standard toolchain; no external dep |
| Type resolver | golang.org/x/tools/go/packages |
Single API for both AST + full type resolution; handles modules natively |
| Build/dep materialization | go mod download |
Required before packages.Load so the module cache is warm; result cached by go.sum hash |
| Packaging | Native binary (go build) |
Zero-runtime-dep distribution; matches Rust/C++ analyzers |
| Analysis depth | Levels 1–4 | Symbol table, resolver call graph, intraprocedural cfg/cdg/ddg, interprocedural SDG |
| Call-graph dispatch | Declared-type resolution via go/types.Selections |
CHA-equivalent; sufficient for cross-package reachability at Level 1 |
| CFG (L3) | Hand-built from go/ast (internal/dataflow) |
Adds what go/cfg does not model as edges: panic exception edges and the defer chain (defer_resume). A differential test checks reachability against golang.org/x/tools/go/cfg on every fixture body |
| Def-use / DDG (L3) | Syntactic reaching definitions over k-limited access paths | go/types objects as bases (shadowing-safe); weak defs through reference arguments; prov: ["ssa"] for parity with the Java and Python L3 |
| SSA (L4) | golang.org/x/tools/go/ssa via ssautil.Packages over the same load, project packages only, built per package under recover |
Bodies only for the project (dependencies from types); a panic degrades instead of aborting |
| Dispatch oracle (L4) | VTA (go/callgraph/vta) over the project's functions, library targets included |
Concrete targets for interface and function-value calls; an interface call also binds the interface method (pass-through) |
| Alias oracle (L4) | Type-based may-alias (structural pointee compatibility, interface pairs, address-taken values, one-level field offset) | Additive points-to ddg edges; an interface so Andersen points-to can replace it without a schema change |
codeanalyzer-go/
├── cmd/codeanalyzer/ # CLI entry point (cobra) — builds the `cango` binary
├── internal/
│ ├── core/ # Orchestrator — delegates only, no inlined analysis
│ ├── schema/ # GoApplication, GoFile, GoType, GoCallable, … (schema.go)
│ ├── options/ # AnalysisOptions + AnalysisLevel constants
│ ├── syntactic_analysis/ # SymbolTableBuilder (packages.Load → AST walk)
│ ├── semantic_analysis/ # CallGraphBuilder (go/types resolver)
│ ├── dataflow/ # L3: body nodes, CFG, CDG, def-use, DDG; Run fans out per callable
│ ├── sdg/ # L4: SSA, VTA dispatch, footprints, vertices, port wiring, summaries, stand-ins, may-alias
│ ├── analysis/ # Pluggable pass interface + registry (topo-ordered pipeline)
│ ├── frameworks/ # BaseEntrypointFinder — extension seam for framework passes
│ └── utils/ # DiscoverGoFiles, IsVendored, IsTestFile, logging
├── packaging/
│ ├── python/ # PyPI wheel wrapper (bundles the prebuilt binary per platform)
│ ├── homebrew/ # generate_formula.sh — Homebrew tap formula generator
│ └── install/ # cango-installer.sh — curl | sh installer
├── testdata/
│ ├── greeter/ # Minimal two-package fixture (basic struct/interface/call sites)
│ ├── multipackage/ # Richer fixture covering embedded fields, variadic params, goroutines, …
│ ├── generics/ # Go 1.18+ generics fixture (Set[T], union-constraint interfaces, Map[T,U])
│ └── chi/ # External-dep fixture (chi v5, vendored) for HTTP handler patterns
The core package is a pure orchestrator: it calls syntactic_analysis → semantic_analysis → analysis.RunPipeline in sequence, with no inlined parsing logic. Framework-specific analysis extends through the analysis/ + frameworks/ layer without touching core.
go test ./...
Tests run against four fixtures: testdata/greeter/ (basic), testdata/multipackage/ (multi-file packages, goroutines, variadic params), testdata/generics/ (Go 1.18+ generics — Set[T], union constraints, multi-type-param functions), and testdata/chi/ (external dependency via vendored chi v5, HTTP handler patterns). All 105 tests cover symbol table correctness, generic receiver attribution, call graph edges, JSON round-trip, output format validation, caching behaviour, and error paths.
go test caches passing results by source hash. To force a full re-run:
go clean -testcache && go test ./...
The analyzer's own CacheDir (used inside tests for analysis_cache.json and go_mod_hash) is written to OS temp directories that are wiped automatically when the test binary exits — there is no persistent on-disk state between test runs. The chi fixture is fully vendored, so tests never require network access.
By default the CLI writes its cache to ~/.cldk/go-cache. To bypass it for a single run:
cango -i ./my-project --eager
To delete it entirely:
rm -rf ~/.cldk/go-cache
If you pass a custom --cache-dir, remove that directory instead.
Releases are cut by pushing a vX.Y.Z tag. The release workflow
cross-compiles the cango binary for all supported platforms and publishes:
cango-installer.sh as GitHub Release assets,codeanalyzer-go (via Trusted Publishing/OIDC), andcodellm-devkit/homebrew-tap.The version is injected into the binary at build time via -ldflags "-X main.version=<tag>", so
cango --version, the wheel version, and the git tag always stay in lockstep. See
packaging/ for the build scripts.
Apache 2.0 — see LICENSE.
Application identity uses --namespace (default: resolved application name) and
--app-name (default: input directory basename). Both segments are always present,
for example can://team/inventory or can://inventory/inventory. Names are raw,
case-sensitive Unicode strings; reserved UTF-8 bytes are percent encoded. Empty,
whitespace-only, control-containing names, slashes, backslashes, . and .. are
rejected. Explicit empty flags are errors. Outputs and graph anchors carry integer
identity_version: 2; regenerate legacy outputs from source. The graph writer
rejects incompatible selected anchors before any DDL or graph write.
Graph relationships retain existing _k values and additionally use private
_fact identity (declared as relationship_fact_property by --emit schema).
Both snapshot and Bolt writers derive it from SHA-256 of the canonical JSON of
the existing pruned relationship properties. Equal endpoint/type/key facts with
different site, context, or evidence properties therefore remain distinct.
Author: codellm-devkit
Apache Software License (Apache-2.0)
Python >=3.8
call-graph
cldk
code analysis
codellm-devkit
go
golang
Author: codellm-devkit
Apache Software License (Apache-2.0)
Python >=3.8
call-graph
cldk
code analysis
codellm-devkit
go
golang
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| codeanalyzer_go-0.3.0-py3-none-win_amd64.whl 5.3 MB With provenance | Python 3 | none | Windows x86-64 | Details for codeanalyzer_go-0.3.0-py3-none-win_amd64.whl |
| codeanalyzer_go-0.3.0-py3-none-manylinux2014_x86_64.whl 5.1 MB With provenance | Python 3 | none | Linux glibc 2.17+ x86-64 | Details for codeanalyzer_go-0.3.0-py3-none-manylinux2014_x86_64.whl |
| codeanalyzer_go-0.3.0-py3-none-manylinux2014_aarch64.whl 4.6 MB With provenance | Python 3 | none | Linux glibc 2.17+ ARM64 | Details for codeanalyzer_go-0.3.0-py3-none-manylinux2014_aarch64.whl |
| codeanalyzer_go-0.3.0-py3-none-macosx_11_0_arm64.whl 4.7 MB With provenance | Python 3 | none | macOS 11.0+ ARM64 | Details for codeanalyzer_go-0.3.0-py3-none-macosx_11_0_arm64.whl |
| codeanalyzer_go-0.3.0-py3-none-macosx_10_12_x86_64.whl 5.2 MB With provenance | Python 3 | none | macOS 10.12+ x86-64 | Details for codeanalyzer_go-0.3.0-py3-none-macosx_10_12_x86_64.whl |
Total release size: 24.9 MB
| Download URL | codeanalyzer_go-0.3.0-py3-none-win_amd64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a7804c84903f79aaa120640394d0af7bc2d15dbee8cfaa073c2a18ae6d42a38e
|
|
BLAKE2b-256 checksum How to use checksums |
5b8096623d3cbef81259ee36c01eab7f00604d5c80b4b375411469c10b386a8c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logcodeanalyzer_go-0.3.0-py3-none-win_amd64.whl
a7804c84903f79aaa120640394d0af7bc2d15dbee8cfaa073c2a18ae6d42a38e
Verifying attestations
| Download URL | codeanalyzer_go-0.3.0-py3-none-manylinux2014_x86_64.whl |
|---|---|
| Size | 5.1 MB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
ec4d3a432389dbf90d27b76bfde4ce866a3f4168f80dfb9772ed2d2a650231d7
|
|
BLAKE2b-256 checksum How to use checksums |
3e7a4db95b0c504ce25d3d8bd6696f69280b8481727e0def5600f5821b318054
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logcodeanalyzer_go-0.3.0-py3-none-manylinux2014_x86_64.whl
ec4d3a432389dbf90d27b76bfde4ce866a3f4168f80dfb9772ed2d2a650231d7
Verifying attestations
| Download URL | codeanalyzer_go-0.3.0-py3-none-manylinux2014_aarch64.whl |
|---|---|
| Size | 4.6 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
565f984b84ef63f0b236e73a1b208fd12b01047a79a1516b5413979761197b90
|
|
BLAKE2b-256 checksum How to use checksums |
aab6b39ddda33dcc25bc2d56d6736c2117790a88776e907e1e4a633db413a7e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logcodeanalyzer_go-0.3.0-py3-none-manylinux2014_aarch64.whl
565f984b84ef63f0b236e73a1b208fd12b01047a79a1516b5413979761197b90
Verifying attestations
| Download URL | codeanalyzer_go-0.3.0-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.7 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
8351707bebe5d7d12830a6e7b167b2166623172bb8eded429c8f368f230def3f
|
|
BLAKE2b-256 checksum How to use checksums |
ef7242f75c5017ad74e8ded820fd1562a18502c3f70830b4e3b8e4e95d4d3370
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logcodeanalyzer_go-0.3.0-py3-none-macosx_11_0_arm64.whl
8351707bebe5d7d12830a6e7b167b2166623172bb8eded429c8f368f230def3f
Verifying attestations
| Download URL | codeanalyzer_go-0.3.0-py3-none-macosx_10_12_x86_64.whl |
|---|---|
| Size | 5.2 MB |
| Tags | Python 3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
77b2e44c07c43e14876175efdd3552c66c0a4d44f95eea2475fc650e5a7fae60
|
|
BLAKE2b-256 checksum How to use checksums |
74ae6888c80a8bf62afdb8e177610f2a8a86f38bf9d10430626bc6946c395ff8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logcodeanalyzer_go-0.3.0-py3-none-macosx_10_12_x86_64.whl
77b2e44c07c43e14876175efdd3552c66c0a4d44f95eea2475fc650e5a7fae60
Verifying attestations
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
All 5 files in this release have been uploaded with provenance metadata.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logcodeanalyzer_go-0.3.0-py3-none-win_amd64.whl
a7804c84903f79aaa120640394d0af7bc2d15dbee8cfaa073c2a18ae6d42a38e
Verifying attestations
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logcodeanalyzer_go-0.3.0-py3-none-manylinux2014_x86_64.whl
ec4d3a432389dbf90d27b76bfde4ce866a3f4168f80dfb9772ed2d2a650231d7
Verifying attestations
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logcodeanalyzer_go-0.3.0-py3-none-manylinux2014_aarch64.whl
565f984b84ef63f0b236e73a1b208fd12b01047a79a1516b5413979761197b90
Verifying attestations
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logcodeanalyzer_go-0.3.0-py3-none-macosx_11_0_arm64.whl
8351707bebe5d7d12830a6e7b167b2166623172bb8eded429c8f368f230def3f
Verifying attestations
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logcodeanalyzer_go-0.3.0-py3-none-macosx_10_12_x86_64.whl
77b2e44c07c43e14876175efdd3552c66c0a4d44f95eea2475fc650e5a7fae60
Verifying attestations
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.