OXIESEC PANEL
- Current Dir:
/
/
opt
/
golang
/
1.22.0
/
src
/
time
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
embed.go
304 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
example_test.go
22.43 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
export_android_test.go
438 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
export_test.go
3.96 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
export_windows_test.go
514 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
format.go
48.45 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
format_rfc3339.go
5.68 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
format_test.go
35.92 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
genzabbrs.go
2.95 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
internal_test.go
2.21 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
mono_test.go
8.29 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
sleep.go
5.66 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
sleep_test.go
18.5 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
sys_plan9.go
1016 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
sys_unix.go
1.38 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
sys_windows.go
1.1 KB
02/02/2024 06:09:55 PM
rw-r--r--
📁
testdata
-
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
tick.go
2.28 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
tick_test.go
4.01 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
time.go
49.63 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
time_test.go
56.04 KB
02/02/2024 06:09:55 PM
rw-r--r--
📁
tzdata
-
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
tzdata_test.go
2.46 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zoneinfo.go
18.15 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zoneinfo_abbrs_windows.go
10.48 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zoneinfo_android.go
2.19 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zoneinfo_android_test.go
386 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
zoneinfo_goroot.go
348 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
zoneinfo_ios.go
1.05 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zoneinfo_js.go
1.03 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zoneinfo_plan9.go
2.69 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zoneinfo_read.go
14.31 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zoneinfo_test.go
9.91 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zoneinfo_unix.go
1.69 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zoneinfo_unix_test.go
2.31 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zoneinfo_wasip1.go
307 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
zoneinfo_windows.go
6.57 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zoneinfo_windows_test.go
1.84 KB
02/02/2024 06:09:55 PM
rw-r--r--
Editing: tzdata_test.go
Close
// Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package time_test import ( "reflect" "testing" "time" _ "time/tzdata" ) var zones = []string{ "Asia/Jerusalem", "America/Los_Angeles", } func TestEmbeddedTZData(t *testing.T) { undo := time.DisablePlatformSources() defer undo() for _, zone := range zones { ref, err := time.LoadLocation(zone) if err != nil { t.Errorf("LoadLocation(%q): %v", zone, err) continue } embedded, err := time.LoadFromEmbeddedTZData(zone) if err != nil { t.Errorf("LoadFromEmbeddedTZData(%q): %v", zone, err) continue } sample, err := time.LoadLocationFromTZData(zone, []byte(embedded)) if err != nil { t.Errorf("LoadLocationFromTZData failed for %q: %v", zone, err) continue } // Compare the name and zone fields of ref and sample. // The tx field changes faster as tzdata is updated. // The cache fields are expected to differ. v1 := reflect.ValueOf(ref).Elem() v2 := reflect.ValueOf(sample).Elem() typ := v1.Type() nf := typ.NumField() found := 0 for i := 0; i < nf; i++ { ft := typ.Field(i) if ft.Name != "name" && ft.Name != "zone" { continue } found++ if !equal(t, v1.Field(i), v2.Field(i)) { t.Errorf("zone %s: system and embedded tzdata field %s differs", zone, ft.Name) } } if found != 2 { t.Errorf("test must be updated for change to time.Location struct") } } } // equal is a small version of reflect.DeepEqual that we use to // compare the values of zoneinfo unexported fields. func equal(t *testing.T, f1, f2 reflect.Value) bool { switch f1.Type().Kind() { case reflect.Slice: if f1.Len() != f2.Len() { return false } for i := 0; i < f1.Len(); i++ { if !equal(t, f1.Index(i), f2.Index(i)) { return false } } return true case reflect.Struct: nf := f1.Type().NumField() for i := 0; i < nf; i++ { if !equal(t, f1.Field(i), f2.Field(i)) { return false } } return true case reflect.String: return f1.String() == f2.String() case reflect.Bool: return f1.Bool() == f2.Bool() case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: return f1.Int() == f2.Int() case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: return f1.Uint() == f2.Uint() default: t.Errorf("test internal error: unsupported kind %v", f1.Type().Kind()) return true } }