Skip to content

Commit

Permalink
fix the test error
Browse files Browse the repository at this point in the history
  • Loading branch information
xgfone committed Apr 8, 2021
1 parent 94dfd7d commit 030297b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func ExampleConfig() {
fmt.Println(conf.GetFloat64("float64"))
fmt.Println(conf.GetString("string"))
fmt.Println(conf.GetDuration("duration"))
fmt.Println(conf.GetTime("time"))
fmt.Println(conf.GetTime("time").UTC())
fmt.Println(conf.GetIntSlice("ints"))
fmt.Println(conf.GetUintSlice("uints"))
fmt.Println(conf.GetFloat64Slice("float64s"))
Expand All @@ -297,7 +297,7 @@ func ExampleConfig() {
fmt.Println(group1.GetFloat64("float64"))
fmt.Println(group1.GetString("string"))
fmt.Println(group1.GetDuration("duration"))
fmt.Println(group1.GetTime("time"))
fmt.Println(group1.GetTime("time").UTC())
fmt.Println(group1.GetIntSlice("ints"))
fmt.Println(group1.GetUintSlice("uints"))
fmt.Println(group1.GetFloat64Slice("float64s"))
Expand All @@ -315,7 +315,7 @@ func ExampleConfig() {
fmt.Println(group2.GetFloat64("float64"))
fmt.Println(group2.GetString("string"))
fmt.Println(group2.GetDuration("duration"))
fmt.Println(group2.GetTime("time"))
fmt.Println(group2.GetTime("time").UTC())
fmt.Println(group2.GetIntSlice("ints"))
fmt.Println(group2.GetUintSlice("uints"))
fmt.Println(group2.GetFloat64Slice("float64s"))
Expand Down
10 changes: 5 additions & 5 deletions struct_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func ExampleOptField() {
fmt.Printf("float64=%v\n", config.Float64.Get())
fmt.Printf("string=%v\n", config.String.Get())
fmt.Printf("duration=%v\n", config.Duration.Get())
fmt.Printf("time=%v\n", config.Time.Get().Format(time.RFC3339))
fmt.Printf("time=%v\n", config.Time.Get().UTC().Format(time.RFC3339))
fmt.Printf("ints=%v\n", config.Ints.Get())
fmt.Printf("uints=%v\n", config.Uints.Get())
fmt.Printf("float64s=%v\n", config.Float64s.Get())
Expand All @@ -91,7 +91,7 @@ func ExampleOptField() {
conf.Set("float64", 123)
conf.Set("string", "abc")
conf.Set("duration", "10s")
conf.Set("time", "2019-07-27 15:39:34")
conf.Set("time", "2019-07-27T15:39:34Z")
conf.Set("ints", []int{1, 2, 3})
conf.Set("uints", []uint{4, 5, 6})
conf.Set("float64s", []float64{1, 2, 3})
Expand All @@ -111,7 +111,7 @@ func ExampleOptField() {
fmt.Printf("float64=%v\n", config.Float64.Get())
fmt.Printf("string=%v\n", config.String.Get())
fmt.Printf("duration=%v\n", config.Duration.Get())
fmt.Printf("time=%v\n", config.Time.Get().Format(time.RFC3339))
fmt.Printf("time=%v\n", config.Time.Get().UTC().Format(time.RFC3339))
fmt.Printf("ints=%v\n", config.Ints.Get())
fmt.Printf("uints=%v\n", config.Uints.Get())
fmt.Printf("float64s=%v\n", config.Float64s.Get())
Expand Down Expand Up @@ -271,7 +271,7 @@ func ExampleOptGroup_RegisterStruct() {
fmt.Printf("float64: %v\n", data.Float64)
fmt.Printf("string: %s\n", data.String)
fmt.Printf("duration: %s\n", data.Duration)
fmt.Printf("time: %s\n", data.Time)
fmt.Printf("time: %s\n", data.Time.UTC())
fmt.Printf("ints: %v\n", data.Ints)
fmt.Printf("uints: %v\n", data.Uints)
fmt.Printf("float64s: %v\n", data.Float64s)
Expand All @@ -289,7 +289,7 @@ func ExampleOptGroup_RegisterStruct() {
fmt.Printf("float64: %v\n", conf.GetFloat64("float64"))
fmt.Printf("string: %s\n", conf.GetString("string"))
fmt.Printf("duration: %s\n", conf.GetDuration("duration"))
fmt.Printf("time: %s\n", conf.GetTime("time"))
fmt.Printf("time: %s\n", conf.GetTime("time").UTC())
fmt.Printf("ints: %v\n", conf.GetIntSlice("ints"))
fmt.Printf("uints: %v\n", conf.GetUintSlice("uints"))
fmt.Printf("float64s: %v\n", conf.GetFloat64Slice("float64s"))
Expand Down

0 comments on commit 030297b

Please sign in to comment.