Whole-struct analysis
Detect direct, promoted, inline, case-only, and embedded-field collisions with related source locations.
TAG104 · TAG105
Static analysis for Go contracts
TagLock understands struct tags as one external contract—across serialization, validation, persistence, embedding, and version evolution.
go install github.com/theworker02/taglock/cmd/taglock@latest
internal/user/model.go:14:2
TAG104 duplicate JSON name "id"
User.ID and User.LegacyID resolve to
the same external field
internal/user/model.go:19:2
TAG301 external naming drift
json="display_name"
yaml="displayName"
internal/user/model.go:23:2
TAG401 sensitive field exposed
PasswordHash is serialized as "password"
One semantic engine
Parse once, resolve the effective field surface, then evaluate the relationships that runtime libraries leave implicit.
Detect direct, promoted, inline, case-only, and embedded-field collisions with related source locations.
TAG104 · TAG105
Compare external names, ignore behavior, omission rules, and required namespaces across one coherent contract.
TAG301–TAG305
Validate options against Go types and flag public exposure of normalized sensitive-field identities.
TAG201 · TAG401
Snapshot canonical wire surfaces, compare revisions, classify compatibility by direction, and enforce deprecation policy.
EVOL001–EVOL903
Model JSON v1 and v2 separately, surface uncertainty, and generate explicit runtime verification for opaque behavior.
JSONMIG001–010
Adopt incrementally
The same engine powers the CLI, go/analysis, custom vet tools, editor fixes, baselines, schemas, and CI reports.
taglock check ./...Find semantic problems without changing source.
taglock baseline create ./...Hide known history while reporting new findings.
taglock snapshot ./...Capture a deterministic external contract.
taglock compare --base main --head HEAD ./...Gate breaking and unknown changes.
Built for evidence
TagLock never claims certainty around arbitrary custom marshalers. It marks contracts partial or opaque, then lets projects generate reviewed fixture tests through an explicit command.
Stable identifiers
Every finding carries a documented ID, severity, remediation, fingerprint, and fix-safety classification.
Open development
Contributions are welcome when they preserve determinism, compatibility, security, and a low false-positive rate.
Contribution guide