summaryrefslogtreecommitdiff
path: root/vendor/codeberg.org/gruf/go-structr/runtime.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/codeberg.org/gruf/go-structr/runtime.go')
-rw-r--r--vendor/codeberg.org/gruf/go-structr/runtime.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/vendor/codeberg.org/gruf/go-structr/runtime.go b/vendor/codeberg.org/gruf/go-structr/runtime.go
index b75dfeba0..1d379b70d 100644
--- a/vendor/codeberg.org/gruf/go-structr/runtime.go
+++ b/vendor/codeberg.org/gruf/go-structr/runtime.go
@@ -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.