Contradictory documentation on usage of ec2/imds GetMetadata #1173
Labels
bug
This issue is a bug.
documentation
This is a problem with documentation.
p3
This is a minor priority issue
queued
This issues is on the AWS team's backlog
s
Effort estimation: small
https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/feature/ec2/[email protected]#Client.GetMetadata
The function returns a value of type
*GetMetadataOutput
. There is no field ofstring
type to be found inGetMetadataOutput
.https://aws.github.io/aws-sdk-go-v2/docs/sdk-utilities/ec2-imds/
includes the following example snippet:
However, as already established, because the return value of
GetMetadata()
is not a string, this example will not produce the expected result:If the caller is responsible for closing
GetMetadataOutput.Content
, that obligation should probably be stated in the documentation.The documentation for other functions, like
GetUserData()
, may also need to be amended.Version of AWS SDK for Go?
Version of Go (
go version
)?go version go1.16.1 darwin/amd64
Steps to reproduce
Here is an example that works:
The text was updated successfully, but these errors were encountered: