I have following sample code:
package main
import (
"fmt"
"reflect"
)
type MyResponse struct {
Code string
Status string
}
type Project struct {
}
func (p *Project) Method1() MyResponse{
return MyResponse{"LN000001", "Requested by Buyer"}
}
func main() {
var p Project
result := reflect.ValueOf(&p).MethodByName("Method1").Call([]reflect.Value{})
code := <??>
status := <??>
fmt.Println("Code: ", code, " Status: ", status)
}
The program should print following output:
Code: LN000001 Status: Requested by Buyer
My query is, what to write in place of “<??>” to achieve this in above sample code ?
Thanks.