-
-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathenum_no_bool.yml
46 lines (38 loc) · 1.15 KB
/
enum_no_bool.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 example
import (
input "github.com/jmattheis/goverter/execution/input"
output "github.com/jmattheis/goverter/execution/output"
)
// goverter:converter
// goverter:enum:unknown @error
type Converter interface {
Convert(input.Color) (output.Color, error)
}
input/enum.go: |
package input
type Color bool
const (
Green Color = true
NotGreen Color = false
)
output/enum.go: |
package output
type Color bool
const (
Green Color = true
NotGreen Color = false
)
success:
- generated/generated.go: |
// Code generated by github.com/jmattheis/goverter, DO NOT EDIT.
package generated
import (
input "github.com/jmattheis/goverter/execution/input"
output "github.com/jmattheis/goverter/execution/output"
)
type ConverterImpl struct{}
func (c *ConverterImpl) Convert(source input.Color) (output.Color, error) {
return output.Color(source), nil
}