tkrajina / typescriptify-golang-structs

A Golang struct to TypeScript class/interface converter
Apache License 2.0
505 stars 87 forks source link

Fix `json:",omitempty"` #70

Open vincentkerdraon opened 1 year ago

vincentkerdraon commented 1 year ago

The json struct tag can be used without a first argument. In this case, the field name must be used. See https://pkg.go.dev/encoding/json

Example code:

type Person struct { Phone string json:",omitempty" }

tkrajina commented 1 year ago

Makes sense, thanks for the PR. Can you also add a test?