Skip to content

Conversation

@vincentkerdraon
Copy link

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"
}

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
Copy link
Owner

tkrajina commented Jul 8, 2023

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

vincentgna added a commit to GoodNotes/typescriptify-golang-structs that referenced this pull request Feb 4, 2024
- Add ability to convert to JSII compatible camelCased fields
- Support valid `json:",omitempty"` tag (with test cases)
- Add `-local-pkg` flag for running tscriptify from local directory

References:
- tkrajina#73
- tkrajina#70
- https://github.com/rogpeppe/gohack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants