Day*Mappings
var id = MON *r = id
DayMappings*r
package main
type Day string
const (
SUNDAY Day = ""
MONDAY Day = "MONDAY"
TUESDAY Day = "TUESDAY"
)
type Mappings string
const (
SUN Mappings = ""
MON Mappings = "MON"
TUE Mappings = "TUE"
)
func main() {
type A struct {
day Day
}
type B struct {
day *Mappings
}
sourceObj := A{day: MONDAY}
destObj := B{}
destObj.day.To(sourceObj.day)
}
func (r *Mappings) To(m Day) {
switch m {
case MONDAY:
*r = MON
case TUESDAY:
*r = TUE
}
}