Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Call to GetAccountSettings API is redundant in blank-go #276

Closed
@gytisrepecka

Description

@gytisrepecka

There is no use running function callLambda() two times:

  1. In init at
  2. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions