Native datatypes
Another important remark regarding the SDK methods is that almost all of the datatypes used as arguments or in struct fields are pointers, even if the data type is native. For example, instead of using a string datatype for a string value, the SDK tends to use *string instead, same with ints and other types. In order to make life easier for the developer, the AWS SDK for Go provides helper methods to convert between native datatypes and their pointers while ensuring nil checks are performed to avoid runtime panics.
The helper method to convert a native data type into a pointer to the same data type follows this pattern: aws.<datatype>. For example, if we call aws.String("hello"), the method will return a pointer to a string ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access