-
-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathauto_map_case_insensitive.yml
44 lines (38 loc) · 1.21 KB
/
auto_map_case_insensitive.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
input:
input.go: |
package example
// goverter:converter
type Converter interface {
// goverter:autoMap Address
// goverter:matchIgnoreCase
Convert(Person) FlatPerson
}
type FlatPerson struct {
Name string
Age int
STREET string
ZipCode string
}
type Person struct {
Name string
Age int
Address Address
}
type Address struct {
Street string
ZipCode string
}
success:
- generated/generated.go: |
// Code generated by github.com/jmattheis/goverter, DO NOT EDIT.
package generated
import execution "github.com/jmattheis/goverter/execution"
type ConverterImpl struct{}
func (c *ConverterImpl) Convert(source execution.Person) execution.FlatPerson {
var exampleFlatPerson execution.FlatPerson
exampleFlatPerson.Name = source.Name
exampleFlatPerson.Age = source.Age
exampleFlatPerson.STREET = source.Address.Street
exampleFlatPerson.ZipCode = source.Address.ZipCode
return exampleFlatPerson
}