Hi was just wondering about the `*Response` struct...
# support-questions-legacy
l
Hi was just wondering about the
*Response
structs in
golang
. Is it like this, that if
err = nil
then the
OK struct
is always
OK != nil
? Just wondering if I have to also check
OK == nil
or can skip it, if
err = nil
. E.g. for the
CreateResetPasswordTokenResponse
, why might that not return an
OK
if no
err
?
r
hey @leandergan in most responses, the response struct contains other sub structs other than
OK
. In this case, you will have to check for
if OK != nil
. But if the response struct contains only one sub struct (which is
OK
), then you can skip the
OK != nil
check - we only added
OK
in this to keep it consistent.
l
ahh, thats good to know. thx 4 the quick response @rp_st .
hi, just a follow up. if a response struck has 2 subs, then one of them will always be
!null
if not
err
, guessing this is the case but just to be sure. 🙂
r
correct
and only one of the sub structs will be
!null