Currently only methods are allowed in goverter:map. It would be useful to support variables / constants to, because they are sometimes already present. E.g.
package example
import "time"
// goverter:converter
type Converter interface {
// goverter:map Value | time:Second
Convert(Input) Output
}
type Input struct {
Name string
}
type Output struct {
Name string
Value time.Duration
}
this should normally convert Input#Name -> Output#Name and use the constant time.Second for Output#Value.
Please :+1: this issue if you like this functionality. If you have a specific use-case in mind, feel free to comment it.
Currently only methods are allowed in
goverter:map
. It would be useful to support variables / constants to, because they are sometimes already present. E.g.this should normally convert
Input#Name
->Output#Name
and use the constanttime.Second
forOutput#Value
.Please :+1: this issue if you like this functionality. If you have a specific use-case in mind, feel free to comment it.