Skip to content

Commit

Permalink
chore: add more friendly warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
liuq19 committed Jul 9, 2024
1 parent 456a3b9 commit 415a18d
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 nil pointer exception (NPE) problem. There might be a data race issue. It is recommended to execute the tests related to the code with the -race compile flag to detect the problem.", (*rt.GoString)(val)))
default:
panic("encoder error!")
}
Expand Down

0 comments on commit 415a18d

Please sign in to comment.