Closed
Description
There is no use running function callLambda()
two times:
- In
init
at - In separate call under
handleRequest
with error handling:
Since it does exactly the same (retrieves settings from GetAccountSettings API), no need to run it two times.
As we might want to have values of those settings before running actual Lambda functionality, perhaps it makes sense leaving them under init
but removing from handleRequest
. As init
function does not return anything, maybe it would make sense to send callLambda
error to log like this:
func init() {
_, err := callLambda()
if err != nil {
log.Printf("ERROR calling GetAccountSettings API: %s", err)
}
}
What do you think? If such change makes sense, I will create pull request.
Metadata
Metadata
Assignees
Labels
No labels