Skip to content

Commit

Permalink
Merge pull request #16 from twpayne/inttype-flag
Browse files Browse the repository at this point in the history
feat: add -inttype flag
  • Loading branch information
twpayne committed Nov 28, 2023
2 parents 9f17595 + a1193ef commit 35f8c60
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/gojsonstruct/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ var (
structTagName = flag.String("structtagname", "", "struct tag name")
typeComment = flag.String("typecomment", "", "type comment")
typeName = flag.String("typename", "T", "type name")
intType = flag.String("inttype", "", "integer type")
useJSONNumber = flag.Bool("usejsonnumber", false, "use json.Number")
goFormat = flag.Bool("goformat", true, "format generated Go code")
output = flag.String("o", "", "output filename")
Expand All @@ -45,6 +46,9 @@ func run() error {
if *abbreviations != "" {
options = append(options, jsonstruct.WithExtraAbbreviations(strings.Split(*abbreviations, ",")...))
}
if *intType != "" {
options = append(options, jsonstruct.WithIntType(*intType))
}
if *packageComment != "" {
options = append(options, jsonstruct.WithPackageComment(*packageComment))
}
Expand Down

0 comments on commit 35f8c60

Please sign in to comment.