add repeat boost filtering logic, update go-structr, general improvements

This commit is contained in:
kim 2025-04-07 17:46:17 +01:00
commit 50805fac53
10 changed files with 153 additions and 114 deletions

View file

@ -70,7 +70,7 @@ func find_field(t reflect.Type, names []string) (sfield struct_field) {
name := names[0]
names = names[1:]
if !is_exported(name) {
panicf("field is not exported: %s", name)
panic(fmt.Sprintf("field is not exported: %s", name))
}
return name
}
@ -94,7 +94,7 @@ func find_field(t reflect.Type, names []string) (sfield struct_field) {
// Check for valid struct type.
if t.Kind() != reflect.Struct {
panicf("field %s is not struct (or ptr-to): %s", t, name)
panic(fmt.Sprintf("field %s is not struct (or ptr-to): %s", t, name))
}
var ok bool
@ -102,7 +102,7 @@ func find_field(t reflect.Type, names []string) (sfield struct_field) {
// Look for next field by name.
field, ok = t.FieldByName(name)
if !ok {
panicf("unknown field: %s", name)
panic(fmt.Sprintf("unknown field: %s", name))
}
// Set next offset value.
@ -258,11 +258,6 @@ func eface_data(a any) unsafe.Pointer {
return (*eface)(unsafe.Pointer(&a)).data
}
// panicf provides a panic with string formatting.
func panicf(format string, args ...any) {
panic(fmt.Sprintf(format, args...))
}
// assert can be called to indicated a block
// of code should not be able to be reached,
// it returns a BUG report with callsite.