-
-
Notifications
You must be signed in to change notification settings - Fork 50
/
default_on_source_struct_target_pointer_inner_error.yml
46 lines (41 loc) · 1.37 KB
/
default_on_source_struct_target_pointer_inner_error.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
input:
input.go: |
package execution
// goverter:converter
type Converter interface {
// goverter:default NewOutputWithDefaults
// goverter:useZeroValueOnPointerInconsistency
Convert(source *Input) (Output, error)
}
type Input struct {
Name int
}
type Output struct {
Name string
}
func NewOutputWithDefaults() Output {
return Output{
Name: "string",
}
}
error: |-
Error while creating converter method:
@workdir/input.go:7
func (github.com/jmattheis/goverter/execution.Converter).Convert(source *github.com/jmattheis/goverter/execution.Input) (github.com/jmattheis/goverter/execution.Output, error)
[source] *github.com/jmattheis/goverter/execution.Input
[target] github.com/jmattheis/goverter/execution.Output
| *github.com/jmattheis/goverter/execution.Input
|
| | github.com/jmattheis/goverter/execution.Input
| |
| | | int
| | |
source*.Name
target .Name
| |
| | string
|
| github.com/jmattheis/goverter/execution.Output
TypeMismatch: Cannot convert int to string
You can define a custom conversion method with extend:
https://goverter.jmattheis.de/reference/extend