forked from tkrajina/typescriptify-golang-structs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add camelCase fieldNames and
json:",omitempty"
support
- 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
- Loading branch information
1 parent
e807dc8
commit 2728b08
Showing
8 changed files
with
682 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,33 @@ | ||
package models | ||
|
||
type Address struct { | ||
// Used in html | ||
City string `json:"city"` | ||
Number float64 `json:"number"` | ||
Country string `json:"country,omitempty"` | ||
} | ||
|
||
type PersonalInfo struct { | ||
Hobbies []string `json:"hobby"` | ||
PetName string `json:"pet_name"` | ||
} | ||
|
||
type Person struct { | ||
Name string `json:"name"` | ||
PersonalInfo PersonalInfo `json:"personal_info"` | ||
Nicknames []string `json:"nicknames"` | ||
Addresses []Address `json:"addresses"` | ||
Address *Address `json:"address"` | ||
Metadata []byte `json:"metadata" ts_type:"{[key:string]:string}"` | ||
Friends []*Person `json:"friends"` | ||
} | ||
package models | ||
|
||
type Address struct { | ||
// Used in html | ||
City string `json:"city"` | ||
Number float64 `json:"number"` | ||
Country string `json:"country,omitempty"` | ||
} | ||
|
||
type PersonalInfo struct { | ||
Hobbies []string `json:"hobby"` | ||
PetName string `json:"pet_name"` | ||
} | ||
|
||
type Person struct { | ||
Name string `json:"name"` | ||
PersonalInfo PersonalInfo `json:"personal_info"` | ||
Nicknames []string `json:"nicknames"` | ||
Addresses []Address `json:"addresses"` | ||
Address *Address `json:"address"` | ||
Metadata []byte `json:"metadata" ts_type:"{[key:string]:string}"` | ||
Friends []*Person `json:"friends"` | ||
} | ||
|
||
type CloudKitDev struct { | ||
Name string | ||
PersonalInfo PersonalInfo | ||
Nicknames []string | ||
Addresses []Address | ||
Address *Address | ||
Metadata []byte | ||
Friends []*Person | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.