I used SetExtension to set a null pointer to string and got this error.
|
if rx.Kind() == reflect.Ptr && !rx.IsNil() { |
|
// Allow pointers-to convertible types |
|
return Validate(rx.Elem().Interface()) |
|
} |
|
return nil, fmt.Errorf("invalid CloudEvents value: %#v", v) |
Code verification null pointer error.
Can we set data to zero value when we encounter null pointer?