Skip to content

Get rid of string pointers, int pointers, aws.String(), etc #205

Closed
@veqryn

Description

@veqryn

The use of pointers (string pointers, integer pointers, etc) all over the SDK really goes against how Golang is supposed to be written.

I realize that pointers (or an optional-type) may still need to be used in places where a value or field is optional and the zero-value is actually meaningfully different than a nil pointer. However, the vast majority of the time there is no difference between the zero-value and a nil pointer.

This is really ugly:

svc.PutObjectRequest(&s3.PutObjectInput{
	Bucket: aws.String("myBucket"),
	Key:    aws.String("myKey"),
	ACL:    s3.ObjectCannedACLPublicRead,
	Body:   body,
})

It should be:

svc.PutObjectRequest(&s3.PutObjectInput{
	Bucket: "myBucket",
	Key:    "myKey",
	ACL:    s3.ObjectCannedACLPublicRead,
	Body:   body,
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    closing-soonThis issue will automatically close in 4 days unless further comments are made.guidanceQuestion that needs advice or information.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions