-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
32 lines (25 loc) · 644 Bytes
/
main.go
File metadata and controls
32 lines (25 loc) · 644 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package main
import (
"context"
"github.com/etiennemarais/world-cities-database/cmd/generate"
"github.com/etiennemarais/world-cities-database/cmd/list"
"github.com/etiennemarais/world-cities-database/pkg/logger"
"github.com/spf13/cobra"
"go.uber.org/zap"
)
func main() {
ctx := context.Background()
logger := logger.New()
logger.Info("booting")
defer func() {
_ = logger.Sync()
}()
var cmd = &cobra.Command{Use: "world-cities-database"}
cmd.AddCommand(
list.Command(ctx, logger),
generate.Command(ctx, logger),
)
if err := cmd.ExecuteContext(ctx); err != nil {
logger.Fatal("execute command", zap.Error(err))
}
}