Skip to content

Commit

Permalink
append error check
Browse files Browse the repository at this point in the history
Co-authored-by: Pavel Gabriel <[email protected]>
  • Loading branch information
mfdeveloper508 and alovak authored Oct 2, 2023
1 parent 92096a3 commit 0293e3a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions field/binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ func (f *Binary) SetData(data interface{}) error {
func (f *Binary) Unmarshal(v interface{}) error {
switch val := v.(type) {
case reflect.Value:
if !val.CanSet() {
return fmt.Errorf("cannot set reflect.Value of type %s", val.Kind())
}

switch val.Kind() { //nolint:exhaustive
case reflect.String:
if !val.CanSet() {
Expand Down

0 comments on commit 0293e3a

Please sign in to comment.