Installation
go get github.com/ygrebnov/model
Requires Go 1.22 or later. Construct one binding per struct type and reuse it:
import "github.com/ygrebnov/model"
binding, err := model.NewBinding[CLIConfig]()
if err != nil {
return err
}
NewBinding checks the struct type and resolves validation rules during construction. The binding is safe to reuse across different objects; synchronize access if callers operate on the same object concurrently.