MCPcopy
hub / github.com/spf13/cast / BenchmarkCommonTimeLayouts

Function BenchmarkCommonTimeLayouts

time_test.go:241–250  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

239}
240
241func BenchmarkCommonTimeLayouts(b *testing.B) {
242 for i := 0; i < b.N; i++ {
243 for _, commonLayout := range []string{"2019-04-29", "2017-05-30T00:00:00Z"} {
244 _, err := cast.StringToDateInDefaultLocation(commonLayout, time.UTC)
245 if err != nil {
246 b.Fatal(err)
247 }
248 }
249 }
250}
251
252func assertTimeEqual(t *testing.T, expected, actual time.Time) {
253 t.Helper()

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…