Skip to content

Commit b379a2e

Browse files
committed
add TimeFormat to README
1 parent d0187d6 commit b379a2e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ json2go generate --url="https://gorest.co.in/public/v2/users"
3737
| Root Object Name | `--root=RootObject` | `string` | Name for top-level object in JSON payload | `Root` |
3838
| Package Name | `--package=api` | `string` | Name of package to generate types into. A nested package path is valid | `main` |
3939
| Output File Name | `--output` | `string` | The name of the file that is generated. If a file is provided as input, will use matching name unless explicitly provided. The ".go" extension is not required and will be automatically appended. | `types.go` |
40+
| Time Format | `--time=2006-01-02` | `string` | Time format to use while parsing strings for potential time.Time variables. View time.Time constants for possible defaults: https://pkg.go.dev/time#pkg-constants | `RFC3339` |
4041
| Debug logging | `--debug` | `bool` | Will output debugging console logs. | `false` |
4142
| Quiet | `--quiet` | `bool` | Will quiet fatal errors. | `false` |
4243
| STDOUT | `--out` | `bool` | Instead of generating a Go file, will instead print the contents to STDOUT | `false` |

cmd/generate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ var generateFlags = []cli.Flag{
5454
&cli.StringFlag{
5555
Name: timeFormatFlag,
5656
Aliases: []string{"t"},
57-
Usage: "Time format to use while parsing strings for potential time.Time variables.",
57+
Usage: "Time format to use while parsing strings for potential time.Time variables. View time.Time constants for possible defaults: https://pkg.go.dev/time#pkg-constants",
5858
Value: time.RFC3339,
5959
},
6060
&cli.BoolFlag{

0 commit comments

Comments
 (0)