chavacava/dbc4go

Design by Contract for Go

26
/ 100
Experimental

This tool helps Go developers ensure their code behaves exactly as intended by automatically checking specified conditions at runtime. You annotate your Go functions and structs with contracts embedded in comments, defining what inputs are valid and what outputs are guaranteed. The tool then processes your code, generating additional checks that will panic if these contracts are violated during execution, making it easier to catch bugs related to function inputs, outputs, or object state.

No commits in the last 6 months.

Use this if you are a Go developer looking to add an extra layer of automated validation and bug detection to your codebase, beyond what standard unit tests might cover, by enforcing explicit pre-conditions, post-conditions, and invariants.

Not ideal if you are not a Go developer or if you prefer to enforce code correctness solely through rigorous testing, static analysis, or type systems without runtime overhead.

Go development software quality runtime validation bug prevention defensive programming
Stale 6m No Package No Dependents
Maintenance 0 / 25
Adoption 7 / 25
Maturity 16 / 25
Community 3 / 25

How are scores calculated?

Stars

35

Forks

1

Language

Go

License

MIT

Last pushed

Mar 31, 2025

Commits (30d)

0

Get this data via API

curl "https://pt-edge.onrender.com/api/v1/quality/ai-coding/chavacava/dbc4go"

Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.