Replies: 2 comments 1 reply
-
Hi @siggimoo , I'm not sure what exactly your question is. func (c *S3) ListBucketsRequest(input *ListBucketsInput) (req *request.Request, output *ListBucketsOutput) {
op := &request.Operation{
Name: opListBuckets,
HTTPMethod: "GET",
HTTPPath: "/",
}
// You can see here that nil inputs get converted to an empty struct.
if input == nil {
input = &ListBucketsInput{}
}
output = &ListBucketsOutput{}
req = c.newRequest(op, input, output)
return
} Thanks, |
Beta Was this translation helpful? Give feedback.
0 replies
-
I am aware that at least some of the code guards against nil inputs -- I haven't checked every single service call. What I'm not readily able to find is any mention of this in the documentation (e.g. here). So it's unclear whether this is behavior I can trust to always be there. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I just happened to notice while reviewing the source code that passing a
nil
input to service calls seems to be allowed, with a zero-value struct being used in its place. For instance, the following two statements are effectively identical:While this is handy, I can't seem to find the behavior documented anywhere and I don't want to rely on it if it's not a standard convention. Does anyone know anything about this?
Beta Was this translation helpful? Give feedback.
All reactions