mirror of
https://github.com/ent/ent.git
synced 2026-05-28 09:49:08 +03:00
all: use %w instead of %v to wrap errors (#1275)
* all: use %w instead of %v for nested errors with fmt.Errorf * all: update generated code to use %w instead of %v for error wrapping
This commit is contained in:
committed by
GitHub
parent
51d19b8e5b
commit
c53b45ddb0
@@ -98,7 +98,7 @@ func ({{ $receiver }} *{{ $.Name }}) assignValues(columns []string, values []int
|
||||
return fmt.Errorf("unexpected type %T for field {{ $f.Name }}", values[{{ $i }}])
|
||||
} else if value != nil && len(*value) > 0 {
|
||||
if err := json.Unmarshal(*value, &{{ $ret }}.{{ $field }}); err != nil {
|
||||
return fmt.Errorf("unmarshal field {{ $f.Name }}: %v", err)
|
||||
return fmt.Errorf("unmarshal field {{ $f.Name }}: %w", err)
|
||||
}
|
||||
}
|
||||
{{- else }}
|
||||
|
||||
Reference in New Issue
Block a user