Skip to content

Commit

Permalink
chore: add more firendly warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
liuq19 committed Jul 9, 2024
1 parent 456a3b9 commit edbad9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/encoder/vars/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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!\nThis is a NPE(nil pointer) problem. There 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!")
}
Expand Down

0 comments on commit edbad9e

Please sign in to comment.