• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DrPsychick / go-alexa-lambda-template / 17412345449

02 Sep 2025 06:18PM UTC coverage: 23.955% (-0.8%) from 24.71%
17412345449

Pull #140

github

DrPsychick
fix: migrate to v3
Pull Request #140: fix(deps): update module github.com/hamba/cmd/v2 to v3

0 of 39 new or added lines in 6 files covered. (0.0%)

1 existing line in 1 file now uncovered.

149 of 622 relevant lines covered (23.95%)

0.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

14.29
/cmd/mydemoskill/lambda.go
1
package main
2

3
import (
4
        "context"
5
        "errors"
6
        "fmt"
7

8
        "github.com/drpsychick/go-alexa-lambda"
9
        mydemoskill "github.com/drpsychick/go-alexa-lambda-template"
10
        "github.com/drpsychick/go-alexa-lambda-template/lambda"
11
        "github.com/drpsychick/go-alexa-lambda-template/lambda/middleware"
12
        "github.com/drpsychick/go-alexa-lambda/skill"
13
        "github.com/hamba/cmd/v3/observe"
14
        "github.com/hamba/timex/mono"
15
        "github.com/urfave/cli/v3"
16
)
17

NEW
18
func runLambda(ctx context.Context, cmd *cli.Command) error {
×
19
        start := mono.Now()
×
20

×
NEW
21
        ctx, cancel := context.WithCancel(ctx)
×
NEW
22
        defer cancel()
×
NEW
23

×
NEW
24
        obsvr, err := observe.New(ctx, cmd, "tocli", &observe.Options{
×
NEW
25
                StatsRuntime: false,
×
NEW
26
        })
×
NEW
27
        if err != nil {
×
NEW
28
                return fmt.Errorf("failed to create observer: %w", err)
×
NEW
29
        }
×
NEW
30
        defer obsvr.Close()
×
NEW
31

×
NEW
32
        app, err := newApplication(obsvr)
×
33
        if err != nil {
×
34
                return err
×
35
        }
×
36
        d := mono.Since(start)
×
37
        app.Statter().Timing("Boot").Observe(d)
×
38

×
39
        sb := newSkill()
×
40
        l := newLambda(app, sb)
×
41

×
42
        ms, err := sb.BuildModels()
×
43
        if err != nil {
×
44
                return err
×
45
        }
×
46
        for l, m := range ms {
×
47
                app.Logger().Info(fmt.Sprintf("accepting locale '%s' invocation '%s'", l, m.Model.Language.Invocation))
×
48
        }
×
49

50
        app.Statter().Timing("Ready").Observe(mono.Since(start))
×
51
        if err := alexa.Serve(l); err != nil {
×
52
                return err
×
53
        }
×
54

55
        return errors.New("Serve() should not have returned")
×
56
}
57

58
func newLambda(app *mydemoskill.Application, sb *skill.SkillBuilder) alexa.Handler {
1✔
59
        h := lambda.NewMux(app, sb)
1✔
60

1✔
61
        h = middleware.WithRequestStats(h, app.Statter())
1✔
62
        return middleware.WithRecovery(h, app.Logger())
1✔
63
}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc