rework metadata
All checks were successful
pr / test (pull_request) Successful in 2m10s
lint / lint (pull_request) Successful in 10m35s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2024-03-09 17:21:20 +03:00
parent 4b261083d6
commit 2f8c0d9f9d
12 changed files with 152 additions and 279 deletions

View File

@@ -532,6 +532,9 @@ func Equal(src interface{}, dst interface{}, excptFields ...string) bool {
}
s := srcVal.MapIndex(key)
d := dstVal.MapIndex(key)
if !s.IsValid() || !d.IsValid() {
return false
}
if !Equal(s.Interface(), d.Interface(), excptFields...) {
return false
}

View File

@@ -35,7 +35,7 @@ func TestUnmarshalJSON(t *testing.T) {
err = json.Unmarshal([]byte(`{"ttl":"1y"}`), v)
if err != nil {
t.Fatal(err)
} else if v.TTL != 31536000000000000 {
} else if v.TTL != 31622400000000000 {
t.Fatalf("invalid duration %v != 31536000000000000", v.TTL)
}
}
@@ -55,7 +55,7 @@ func TestParseDuration(t *testing.T) {
if err != nil {
t.Fatalf("ParseDuration error: %v", err)
}
if td.String() != "8760h0m0s" {
if td.String() != "8784h0m0s" {
t.Fatalf("ParseDuration 1y != 8760h0m0s : %s", td.String())
}
}