question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hot reloading not working for go lambdas?

See original GitHub issue

Is it just me or hot-reloading doesn’t work for lambdas written in golang?

cmd

aws-sam-local local start-api

hello/main.go

package main

import (
	"github.com/aws/aws-lambda-go/events"
	"github.com/aws/aws-lambda-go/lambda"
)

type Response struct {
	Message string `json:"message"`
}

func Handler(request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
	return events.APIGatewayProxyResponse{
		Body:       "Go Serverless v1.0! Your function executed successfully!",
		StatusCode: 200,
	}, nil
}
func main() {
	lambda.Start(Handler)
}

template.yml

AWSTemplateFormatVersion : '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: A hello world application.
Resources:
  HelloFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: bin/hello
      Runtime: go1.x
      Events:
        Vote:
          Type: Api
          Properties:
            Path: /hello
            Method: get

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
uccmencommented, May 28, 2018

thanks @mijdavis2, I implemented a workaround (in the meantime) for hot reload to work when developing Go lambdas locally - https://github.com/uccmen/serverless-go

3reactions
jfusscommented, Oct 13, 2020

@uccmen We do support hot-reloading of each language. The term hot-reloading to us means we will always mount the CodeUri on the next invoke. This allows you to stand up one api locally, and change/build your code outside that process to be reflected on the next invoke.

Closing this as we currently support it, but if we have a misunderstanding please reopen or create a new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hot reloading not working for go lambdas? · Issue #353 - GitHub
When running local start-api could you build the invoked function defined in CodeUri before mounting to Docker . Running sam build every time...
Read more >
serverless offline start hot reload not working - Stack Overflow
Try using this command to start your server: serverless offline start --reloadHandler. reloadHandler Reloads handler with each request.
Read more >
Hot reloading not working : r/gatsbyjs - Reddit
Worked for a while but now I have to restart the server constantly to get it going. I found some stackoverflow posts but...
Read more >
I made a local development, debugging and hotreload tool for ...
The lambda developer experience is pretty awful. I generally put "main" methods in all my lambdas so I can test them locally, but...
Read more >
Hot Swapping - LocalStack Docs
Code hot-swapping for JVM Lambdas. Since lambda containers lifetime is usually limited, regular hot code swapping techniques are not applicable here.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found