serverless-offline icon indicating copy to clipboard operation
serverless-offline copied to clipboard

feat: Go replace

Open heyanlong opened this issue 1 year ago • 3 comments

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

heyanlong avatar May 31 '23 11:05 heyanlong

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.

daniel0707 avatar Aug 09 '23 08:08 daniel0707

Are there any updates on this?

adherb avatar Aug 26 '23 05:08 adherb

@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.

DorianMazur avatar Apr 24 '24 06:04 DorianMazur

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.

dherault avatar Aug 17 '24 19:08 dherault