From 2cc5d6269d2ad3326c4ba4c6378fb0e9404646d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 11:03:57 +0100 Subject: [chore]: Bump codeberg.org/gruf/go-structr from 0.9.0 to 0.9.6 (#3973) Bumps codeberg.org/gruf/go-structr from 0.9.0 to 0.9.6. --- updated-dependencies: - dependency-name: codeberg.org/gruf/go-structr dependency-version: 0.9.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- vendor/codeberg.org/gruf/go-structr/runtime.go | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'vendor/codeberg.org/gruf/go-structr/runtime.go') diff --git a/vendor/codeberg.org/gruf/go-structr/runtime.go b/vendor/codeberg.org/gruf/go-structr/runtime.go index cd7f8d7a1..b75dfeba0 100644 --- a/vendor/codeberg.org/gruf/go-structr/runtime.go +++ b/vendor/codeberg.org/gruf/go-structr/runtime.go @@ -1,10 +1,9 @@ -//go:build go1.22 || go1.23 +//go:build go1.22 && !go1.25 package structr import ( "fmt" - "os" "reflect" "runtime" "strings" @@ -140,7 +139,7 @@ func extract_fields(ptr unsafe.Pointer, fields []struct_field) []unsafe.Pointer // Prepare slice of field value pointers. ptrs := make([]unsafe.Pointer, len(fields)) if len(ptrs) != len(fields) { - panic("BCE") + panic(assert("BCE")) } for i, field := range fields { @@ -264,12 +263,12 @@ func panicf(format string, args ...any) { panic(fmt.Sprintf(format, args...)) } -// should_not_reach can be called to indicated a -// block of code should not be able to be reached, -// else it prints callsite info with a BUG report. +// assert can be called to indicated a block +// of code should not be able to be reached, +// it returns a BUG report with callsite. // //go:noinline -func should_not_reach(exit bool) { +func assert(assert string) string { pcs := make([]uintptr, 1) _ = runtime.Callers(2, pcs) fn := runtime.FuncForPC(pcs[0]) @@ -280,9 +279,11 @@ func should_not_reach(exit bool) { funcname = funcname[i+1:] } } - if exit { - panic("BUG: assertion failed in " + funcname) - } else { - os.Stderr.WriteString("BUG: assertion failed in " + funcname + "\n") - } + var buf strings.Builder + buf.Grow(32 + len(assert) + len(funcname)) + buf.WriteString("BUG: assertion \"") + buf.WriteString(assert) + buf.WriteString("\" failed in ") + buf.WriteString(funcname) + return buf.String() } -- cgit v1.2.3