File tree Expand file tree Collapse file tree 4 files changed +6
-5
lines changed
Expand file tree Collapse file tree 4 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 1616 - name : Set up Go
1717 uses : actions/setup-go@v4
1818 with :
19- go-version : ' 1.20 '
19+ go-version : ' 1.16 '
2020
2121 - name : Test
2222 run : go test -v ./...
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ func TestTime(t *testing.T) {
2626
2727 err = flagset .Parse ([]string {"-t" , "2016-Dec-13==16:03:02" })
2828 require .NoError (t , err )
29- expeted , _ := time .Parse (time . DateTime , "2016-12-13 16:03:02" )
29+ expeted , _ := time .Parse ("2006-01-02 15:04:05" , "2016-12-13 16:03:02" )
3030 assert .Equal (t , expeted , config .T )
3131}
3232
Original file line number Diff line number Diff line change 11module github.com/itzg/go-flagsfiller
22
3- go 1.20
3+ go 1.16
44
55require (
66 github.com/iancoleman/strcase v0.2.0
Original file line number Diff line number Diff line change @@ -12,8 +12,9 @@ func init() {
1212}
1313
1414// DefaultTimeLayout is the default layout string to parse time, following golang time.Parse() format,
15- // could be overriden by struct field tag "layout"
16- var DefaultTimeLayout = time .DateTime
15+ // can be overridden per field by field tag "layout". Default value is "2006-01-02 15:04:05", which is
16+ // the same as time.DateTime in Go 1.20
17+ var DefaultTimeLayout = "2006-01-02 15:04:05"
1718
1819type timeValue struct {
1920 t * time.Time
You can’t perform that action at this time.
0 commit comments