gencodec
gencodec copied to clipboard
Command gencodec generates marshaling methods for Go struct types.
Example: IMO if the generic is constrained to support json marshal and unmarshal the generator should be able to handle it
@fjl are you open to adding SSZ here? I can implement.
The issue occurs when I try to replace `**big.Int` with `**hexutil.Big`. ```go //go:generate go run github.com/fjl/gencodec -type OverrideAccount -field-override overrideMarshaling -out gen_override_json.go // OverrideAccount indicates the overriding fields of account...
https://pkg.go.dev/encoding/json#Decoder.DisallowUnknownFields Add support to this, may be by a flag to gencodec?
Fixes https://github.com/fjl/gencodec/issues/8 --- As seen here where we are using [golang/dep](https://github.com/golang/dep) to vendor our dependencies: https://github.com/smartcontractkit/chainlink/pull/680#issuecomment-432803279 ### Source ```golang package store import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" ) //go:generate gencodec -type Log...
When running `go generate ./...`, `gencodec` writes the vendored import paths rather than the correct ones: As seen here where we are using [golang/dep](https://github.com/golang/dep) to vendor our dependencies: https://github.com/smartcontractkit/chainlink/pull/680#issuecomment-432803279 ###...
test on win7 64bit
Currently there seems to be no correlation between this package's `optional` tag and for example the json `omitempty` tag. I.e. if I specify a field in this package to be...
I try to generate the `ExecutionPayload` json encoder in [this branch](https://github.com/gballet/go-ethereum/pull/456) with go 1.22, and I get the following stack trace: ``` > go run github.com/fjl/gencodec -type Header -field-override headerMarshaling...
When overriding an aliased type for which conversion is required, the eventual calls to `underlying()` via `checkConvertible()` used to return `nil`. This change resolves the alias inside the `underlying()` loop,...