4 ms·
I'm all about passing structs and objects into methods and not make the arity too complex. However, there's passing the struct and there's passing a pointer to
by avitzurel 11y ago
I'm all about passing structs and objects into methods and not make the arity too complex.
However, there's passing the struct and there's passing a pointer to the struct.
Also, if you look at the structs, you see that instead of just passing strings, they pass aws.string("some-string-value") which actually just takes the string and makes a pointer of it.
That's what I'm talking about when I say it's too verbose, it's just a lot of unnecessary things like this.
- lobster_johnson 11y agoIt's not unnecessary, though. In Go, a string cannot be nil, as you know; it is initialized to the value of an empty string. That's not true in any other languages, and even the Go AWS library cannot use that as a signal of intent, because you may have intended to use an empty string. Granted, I don't know if there are any calls where an empty string is an actual valid parameter. But it seems Amazon is erring on the side of explicitness here. I agree that the AWS library isn't ergonomic. But Go is forcing their hand, in my opinion.