francoispqt / gojay

high performance JSON encoder/decoder with stream API for Golang
MIT License
2.11k stars 113 forks source link

gojay generated code doesn't work for type names starting with K #163

Open bramp opened 3 years ago

bramp commented 3 years ago

When generating code with gojay, it does not support types starting with K. For example:

type Key struct {...}

generates the code:

func (k *Key) UnmarshalJSONObject(dec *gojay.Decoder, k string) error {
...
}

This doesn't compile, since both the alias and a argument use the same variable, k.