[Solved] Determining what is returned from a go function


This part of the function signature is exactly what the function returns.

(*PutRecordOutput, error)

So this one will return a pointer to a PutRecordOutput plus an error (which by convention is returned as nil if no error occurred).

If you look at the source code for the function, return statements will have to be consistent with that, so that can also help you understand how the return values are built.

But, please note that in some cases you could have named output arguments, like:

(output *PutRecordOutput, err error)

In that case, output and err will be valid local variables inside the function, and you might see a plain return statement like this:

return

Just keep in mind that one would implicitly be like doing:

return output, err

solved Determining what is returned from a go function