-
-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathdefault_on_pointer_inner_error.yml
More file actions
48 lines (43 loc) · 1.43 KB
/
Copy pathdefault_on_pointer_inner_error.yml
File metadata and controls
48 lines (43 loc) · 1.43 KB
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
47
48
input:
input.go: |
package execution
// goverter:converter
type Converter interface {
// goverter:default NewOutputWithDefaults
// goverter:default:update
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
|
| *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