func getExpectedData(sData string, okJ interface{}) (string, string, cr.Error, error) { found, exp, res, e, err := cr.GetExpectedData(sData, okJ) if found == true { return exp, res, e, err } switch okJ.(type) { case *password.UserPwd: // expiration time is not compared res = cr.RemoveSpaces(string(sData)) var user password.UserPwd json.Unmarshal([]byte(sData), &user) user.Expiration = okJ.(*password.UserPwd).Expiration if reflect.DeepEqual(user, okJ.(*password.UserPwd)) == false { data, _ := json.Marshal(okJ.(*password.UserPwd)) exp = string(data) } else { exp = res } default: panic(fmt.Sprintf("Error unknown type: value: %v", okJ)) } if err != nil { err = json.Unmarshal([]byte(sData), &e) } return exp, res, e, err }
func getExpectedData(sData string, okJ interface{}) (string, string, cr.Error, error) { found, exp, res, e, err := cr.GetExpectedData(sData, okJ) if found == true { return exp, res, e, err } switch okJ.(type) { case en.EntityManager: res = cr.RemoveSpaces(string(sData)) d1, _ := json.Marshal(okJ.(en.EntityManager)) var us en.EntityManager json.Unmarshal([]byte(sData), &us) if reflect.DeepEqual(us, okJ.(en.EntityManager)) == false { exp = string(d1) } else { exp = res } default: panic(fmt.Sprintf("Error unknown type: value: %v", okJ)) } if err != nil { err = json.Unmarshal([]byte(sData), &e) } return exp, res, e, err }