Module split

This commit is contained in:
Ian Gulliver
2023-04-20 18:01:36 +00:00
parent e0c92c24fb
commit f50e6e228c
30 changed files with 4293 additions and 0 deletions

20
equal.go Normal file
View File

@@ -0,0 +1,20 @@
package path
import "time"
func Equal(obj any, path string, matchStr string) (bool, error) {
return op(obj, path, matchStr, equal)
}
func equal(obj, match any, _ string) bool {
switch objt := obj.(type) {
case time.Time:
tm := match.(*timeVal)
// TODO: Replace Truncate() with a timezone-aware version
return tm.time.Equal(objt.Truncate(tm.precision))
default:
return obj == match
}
}