dherault / serverless-offline

Emulate AWS λ and API Gateway locally when developing your Serverless project
MIT License
5.19k stars 796 forks source link

feat: Go replace #1693

Closed heyanlong closed 2 weeks ago

heyanlong commented 1 year ago

Description

Add a new option for Golang runner to fix the incompatibility between local running and AWS.

You can use sls offline start --stage local --goReplace bin=cmd to tell the runner how to find source files.

How to work?

functions:
  hello:
    handler: bin/hello  # <------- it will automatically replace here with cmd/hello/main.go
    events:
      - httpApi:
          path: /hello
          method: get

1644 #1358

daniel0707 commented 1 year ago

I will read up on the Go issues and see if this is the way to go, or is there a better change to make this compliant with AWS.

adherb commented 1 year ago

Are there any updates on this?

DorianMazur commented 4 months ago

@heyanlong I don't think this is a right solution. We should take a closer look at why this doesn't work with the handler configuration that works on AWS.

dherault commented 2 weeks ago

Closing because this PR has been open for too long. Sorry it was not merged, please publish a newer PR if you still want this behavior in the codebase.