From 75b82967e46829ad38056ac2feed1e3f6dafebbf Mon Sep 17 00:00:00 2001 From: "liuqiang.06" Date: Tue, 9 Jul 2024 19:35:47 +0800 Subject: [PATCH] chore: add more firendly warnings --- internal/encoder/vars/errors.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/encoder/vars/errors.go b/internal/encoder/vars/errors.go index 2e7622421..5f434ab40 100644 --- a/internal/encoder/vars/errors.go +++ b/internal/encoder/vars/errors.go @@ -58,7 +58,7 @@ const ( func GoPanic(code int, val unsafe.Pointer) { switch(code){ case PanicNilPointerOfNonEmptyString: - panic(fmt.Sprintf("val: %#v has nil pointer while its length is not zero!", (*rt.GoString)(val))) + panic(fmt.Sprintf("val: %#v has nil pointer while its length is not zero!\nThere maybe a data race problem. Recommand executing the tests about code with `-race` compile flag to detect the problem.", (*rt.GoString)(val))) default: panic("encoder error!") }